Solutions for can't use mail() in php 4.3.11 in Redhat Fedora 3 when SElinux is enabled



Looks like this is a common issue:

If you installed linux Fedora 3 with the default configuration and latest
patches, you will have Apache/2.0.53 (Fedora) and PHP 4.3.11 in your box.

Without any change you can use sendmail, that means you can use mail under
Terminal, but probably you can not use mail() in php.

The error message in maillog will looks like:
"SYSERR(APACHE), Can't write, ... Permission denied."

I spent several days to search Google and manual, no result. With the help
of ¨¢lvaro G. Vicario in this group, the solution is SELinux. Simply disable
SELinux or Check the "Disable SELinux protection for httpd daemon" in
SElinux config solves the problem within 1 second.

Thanks Alvaro.

Not sure if this will effect FC4 or not. I remember the php mail() works in
my FC4(php5), but I can not remember during the linux install did I disable
the SELinux or not. But looks like this is SELinux thing not PHP's so the
version of PHP will not effect this. I have deleted the FC4 so I can not try
now.

Ben
Toronto, Canada


.



Relevant Pages

  • FC 7 Booting exception
    ... SELinux: Initializing. ... PCI: Using configuration type 1 ... ata1: soft resetting port ...
    (Fedora)
  • RE: [PHP] (SOLVED) /etc/php.init changes not honored
    ... The problem turned out to be selinux. ... Access Control (MAC, enhanced permissions using contexts). ... Create a file with the right permissions / context. ... In phpinfo() output, PHP tells you where it is looking for its php.ini ...
    (php.general)
  • Re: Serious Privileges Problem: Please Help
    ... Did the suggested changes to the Apache configuration help at all? ... 17645 pts/0 S+ 0:00 grep selinux ... serve python pages on a CentOS server. ...
    (comp.lang.python)
  • Re: Fedora Core 3 Update: selinux-policy-targeted-1.17.30-3.15
    ... kernel, rebooted and everything is working ok, for now. ... >> improve the security of the Flask operating system. ... >> This package contains the SELinux example policy configuration along ...
    (Fedora)
  • Re: selinux question(s) (/home really = /n/home..)
    ... configuration source at position 0 ... in group 'pulse-rt' and PolicyKit refuse to grant us priviliges. ... enabling real-time scheduling please acquire the appropriate PolicyKit ... local policy, which took care of the selinux alert, but still didn't fix ...
    (Fedora)