简体   繁体   中英

PHP mail() / sendmail not working since Apache 2.4 PHP7 upgrade

Since upgrading to PHP7 every single script on my server using the PHP mail function no longer works :-(

At the same time, I also upgraded from Apache 2.2 to 2.4, and I have a feeling this is possibly where the problem lies.

My php.ini file contains:

sendmail_path = /usr/sbin/sendmail -t -I

Sendmail does send emails if I try from the command line, so I know it is working. I have found an error that I believe is possibly related to Apache and permissions in the exim_paniclog:

unable to set gid=995 or uid=0 (euid=0): forcing real = effective

I hope someone may have come across this problem and could possibly shed some light on it for me. Thanks in advance!

Three things to try:

1) in exim, set trusted_users = apache (or whatever your web server user is).

2) Try turning off SELinux and resarting everything. If it works now, but didn't work previously, then you'll need to either disable SELinux or learn how to configure it to allow what you need.

3) See http://blog.gaiterjones.com/send-php-mail-ubuntu-upgrade/ . Explicitly define the ITK MPM module LimitGIDRange parameter in the /etc/apache2/mods-available/mpm_prefork.conf module configuration to something like

LimitUIDRange 0 2000

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM