当前位置:网站首页>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 input number and standard digit number are compared. The problem of adding 0 to 0
- JS general form submission 1-onsubmit
- JS get DPI, PX to cm, cm to PX
- Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
- Invalid Z-index problem
- Spring cup eight school league
- Exercise 6-1 classify and count the number of characters
- JVM垃圾回收机
猜你喜欢

Dlopen() implements dynamic loading of third-party libraries
[email protected])|制备路线"/>叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线

GRPC的四种数据流以及案例

Exercise 10-8 recursive implementation of sequential output of integers

Current situation, analysis and prediction of information and innovation industry

JVM object lifecycle
[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)"/>MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)

QT learning 17 dialog box and its types

npm install卡住与node-npy的各种奇怪报错
[email protected] Nanoparticles) | nano metal organic framework carry"/>Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
随机推荐
Back to top implementation
2021年区域赛ICPC沈阳站J-Luggage Lock(代码简洁)
Exercise 10-1 judge the three digits that meet the conditions
Failure of vector insertion element iterator in STL
Message subscription and publishing
MongoDB索引
Onmenusharetimeline custom shared content is invalid, and the title and icon are not displayed
Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email
Leetcode (4) -- find the median of two positively ordered arrays
QT learning 22 layout manager (I)
超简单手机地图开发
JS continues to explore...
Redis: redis data structure and key operation commands
JS download files through URL links
JS Part 2
剑指 Offer 28. 对称的二叉树
Exercise 7-6 count capital consonants
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
JS general form submission 1-onsubmit
protobuf与grpc