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.

link|improve this question
The permission cannot be 666, for then the sendmail binary is not executable. – adamo Jan 27 at 11:16
yes 777 now but not working yet Thanks . Error must be somewhere else – kingzuphur Jan 27 at 11:45
What do logs say now? – symcbean Jan 27 at 11:47
Still the error log [Fri Jan 27 06:25:23 2012] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0 [Fri Jan 27 06:25:23 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Fri Jan 27 06:25:28 2012] [notice] Digest: generating secret for digest authentication . [Fri Jan 27 06:25:28 2012] [notice] Digest: done [Fri Jan 27 06:25:29 2012] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.0-fips SVN/1.6.11 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations sh: /usr/sbin/sendmail: Permission denied – kingzuphur Jan 27 at 11:57
feedback

2 Answers

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

link|improve this answer
Thanks ,It was. Now I changed it to SELinux disabled . But Still no luck. – kingzuphur Jan 27 at 11:40
feedback

What is the user:group of php/apache ?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.