LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail works fine on redhat but PHP unable to use that (https://www.linuxquestions.org/questions/linux-server-73/sendmail-works-fine-on-redhat-but-php-unable-to-use-that-4175560835/)

tangocharlie 12-07-2015 01:10 AM

Sendmail works fine on redhat but PHP unable to use that
 
Hi, I have problem sending mail with PHP. on LAMP (redhat 7 server). I configured "sendmail" which I am able to send email using the following command:
$ sendmail toemail@something.com <press enter>
message body <press enter>
ctrl+d (sends message)
and the message is received by any mentioned email address, successfully.
But when I use PHP scripts (working fine on other servers), PHP scripts are unable to send any email.
No error is there in /etc/mail/maillog.
and I have tried with different paths in php.ini in sendmail_path
e.g:
usr/sbin/sendmail -t -i

usr/sbin/sendmail -t

usr/sbin/sendmail
neither of the three does anything.

permission for /usr/sbin/sendmail is 666

Please suggest.

berndbausch 12-07-2015 04:39 AM

Quote:

Originally Posted by tangocharlie (Post 5460822)
No error is there in /etc/mail/maillog

You mean there is no trace in the mail log.

What distro and version is this?
What's the PHP code?
Can you confirm that the PHP code that executes sendmail is actually executed?

To be honest, I don't know PHP, but is there any place where an error in a PHP program would be logged? I am asking because a path name without leading slash, like usr/bin/sendmail, is very unlikely to work.

EDIT: /etc/mail/maillog is a strange location for a log file. Is it a symbolic link to /var/log? Regarding mail logs, see also http://serverfault.com/questions/596...og-of-sendmail.

tangocharlie 12-10-2015 11:04 PM

SELinux was enabled
 
Thanks for the reply. It worked. The reason of it not working was SELinux was enabled.


All times are GMT -5. The time now is 01:45 AM.