CentOS 7 + SELinux 安裝 Joomla 解決 Sendmail 及 PHP Mail問題

CentOS系統網站安裝、架設與管理
回覆文章
inho
文章: 51
註冊時間: 2017-12-08, 23:00

CentOS 7 + SELinux 安裝 Joomla 解決 Sendmail 及 PHP Mail問題

文章 inho » 2018-10-21, 18:30

從最陽春安裝 CentOS 7.X,再安裝 Joomla 後出現 無法寄信功能 (Event_Booking),解決辦法:

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:

$ sudo setsebool -P httpd_can_network_connect=1


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

$ sudo setsebool -P httpd_can_sendmail=1

This should fix both issues.

回覆文章