当前位置:网站首页>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
边栏推荐
- JS general form submission 1-onsubmit
- 金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
- jvm-运行时数据区
- Onmenusharetimeline custom shared content is invalid, and the title and icon are not displayed
- Back to top implementation
- JS Part III
- MongoDB数据库入门的常用命令
- 别再问自己适不适合做软件测试了
- [combinatorics] permutation and combination (two counting principles, examples of set permutation | examples of set permutation and circle permutation)
- Doxorubicin loaded on metal organic framework MIL-88 DOX | folic acid modified uio-66-nh2 doxorubicin loaded [email
猜你喜欢
Current situation, analysis and prediction of information and innovation industry
Metal organic framework (MOFs) antitumor drug carrier | pcn-223 loaded with metronidazole | uio-66 loaded with ciprofloxacin hydrochloride(
allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取
Interface for querying IP home
QT learning 19 standard dialog box in QT (top)
protobuf与grpc
RocksDB LRUCache
Example analysis of QT learning 18 login dialog box
小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。
Nucleic acid modified metal organic framework drug carrier | pcn-223 metal organic framework encapsulated ad adamantane | zif-8 encapsulated adriamycin (DOX)
随机推荐
Exercise 9-1 time conversion
Function calling convention
Exercise 10-2 recursive factorial sum
虽然不一定最优秀,但一定是最努力的!
FPGA测试方法以Mentor工具为例
Dlopen() implements dynamic loading of third-party libraries
Fabric. JS document
Redis: redis data structure and key operation commands
QT learning 19 standard dialog box in QT (top)
jvm-运行时数据区
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
全局事件总线
selenium 浏览器(1)
Example analysis of QT learning 18 login dialog box
MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
战略、战术(和 OKR)
Too many files with unapproved license
js 2023. String pair equal to the target string after connection
MongoDB数据库入门的常用命令