解决CentOS下无法发送邮件的问题 + selinux

来源:互联网 发布:京东抢券软件安卓 编辑:程序博客网 时间:2024/06/05 07:18
In the newer Fedoras (and perhaps other Linux installations). SELinux is set to enforce by default, one of the areas you'll notice this causing issues is with mail (whether connecting via port 25 to SMTP, or using PHP mail().

The solution to both of these scenarios is as follows:

To allow PHP/Apache to connect to port 25 issue the following commands as root:

setsebool -P httpd_can_network_connect=1


To allow PHP mail() to work issue the following command as root:

setsebool -P httpd_can_sendmail=1

This should fix both issues.
阅读全文
0 0
原创粉丝点击