4

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!

Matt Raines
  • 4,149
  • 8
  • 31
  • 34
KingRidgehead
  • 85
  • 1
  • 8
  • 2
    Are you sure PHP5 and PHP7 use the same php.ini file? Does the correct sendmail_path appear in the output if you run `phpinfo();`? – Matt Raines May 25 '16 at 08:25
  • Hello Matt. The below response solved it for me. Yes phpinfo() did show the correct path. Thanks for your input though. – KingRidgehead May 25 '16 at 11:50

1 Answers1

3

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
Chris Lear
  • 6,592
  • 1
  • 18
  • 26
  • Most likely option 3) is the one to use. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=797653 as well (it's marked as a bug, but wontfix) – Chris Lear May 25 '16 at 09:23
  • Thank you Chris! You are a star. It was in fact point 3 that solved this for me. I really appreciate your help :-) – KingRidgehead May 25 '16 at 11:48