当前位置:网站首页>LNMP环境mail函数不能发送邮件解决
LNMP环境mail函数不能发送邮件解决
2022-07-03 13:53:00 【星哥玩云】
使用LNMP环境,在探针里测试发送邮件,但是失败了。已经确定mail()函数是开启的,于是乎,Google一下,发现了一个方法不错,Mark一下。
问题根源
没有安装或启动 sendmail 组件
解决办法
我是新手,命令不熟,所以写的很详细,老鸟勿喷哦
1.重新安装 sendmail 组件,我用的是 CentOS ,使用下面的命令安装
yum install sendmail
2.使用下面的命令重启php-fpm进程
/etc/init.d/php-fpm restart
3.检测sendmail是否运行正常
/etc/init.d/sendmail status
如果显示正在运行running 就可以。
可能用到的命令
/etc/init.d/sendmail start (启动sendmail)
/etc/init.d/sendmail stop (关闭sendmail)
/etc/init.d/sendmail restart (重启sendmail)
4.配置php.ini,填写sendmail的绝对路径
使用命令打开编辑php.ini
vi /usr/local/php/etc/php.ini
输入?sendmail_path 查找定位(或者手动跳转找到sendmail_path),你会发现默认是下面的代码
;sendmail_path =
按 i 进入编辑,将这行修改为
sendmail_path = /usr/sbin/sendmail -t -i
按 Esc 键退出编辑,输入 :wq 保存退出
5.重启php-fpm进程
/etc/init.d/php-fpm restart
边栏推荐
- 天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
- 虽然不一定最优秀,但一定是最努力的!
- 28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
- 7-9 find a small ball with a balance
- js . Find the first palindrome string in the array
- Exercise 10-1 judge the three digits that meet the conditions
- selenium 浏览器(1)
- Exercise 8-7 string sorting
- Exercise 10-2 recursive factorial sum
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
猜你喜欢

Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值

JVM class loading

Spring cup eight school league

JS first summary

Vite project commissioning

allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取

Redis: commandes d'action pour les données de type chaîne

Rasp implementation of PHP

npm install卡住与node-npy的各种奇怪报错

Leetcode (4) -- find the median of two positively ordered arrays
随机推荐
Failure of vector insertion element iterator in STL
Back to top implementation
Duet date picker (time plug-in that can manually enter the date)
[combinatorics] permutation and combination (examples of combinatorial number of multiple sets | three counting models | selection problem | combinatorial problem of multiple sets | nonnegative intege
How to bold text in AI
JVM object lifecycle
Uniapp skills - scrolling components -1
中国PETG市场预测及战略研究报告(2022版)
Simulated access
Exercise 6-6 use a function to output an integer in reverse order
C language,%d% Difference between 2D%2d%02d
Understanding of closures
28: Chapter 3: develop Passport Service: 11: define attributes in the configuration file, and then obtain them in the code;
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs
“又土又穷”的草根高校,凭什么被称为“东北小清华”?
中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿
Nucleic acid modified metal organic framework drug carrier | pcn-223 metal organic framework encapsulated ad adamantane | zif-8 encapsulated adriamycin (DOX)
【吉林大学】考研初试复试资料分享
虽然不一定最优秀,但一定是最努力的!