Php – apache , php , sendmail not working

apache-2.2PHPsendmail

I am using apache, php and sendmail. I can send mail from command line with sendmail.

However, in php file, mail function is not working.

Then, I run that php email test file from command line. It works.

#>php mail_test.php

I thought it is apache issue and I changed httpd_can_sendmail on. But it is still not working. I checked sendmail permission and it is 666.

I checked httpd error log and I found this:

sh: /usr/sbin/sendmail: Permission denied.

I don't know where to change permission anymore.

Best Answer

This thread (look at the bottom) suggests that it may be a problem with SELinux permissions. Do you have SELinux enabled?