Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

A web server I manage is having problems sending mail from PHP. This server uses exim4 for MTA, and it is configured correctly.

I can send emails from PHP's CLI, but not from the web. i.e. if I do "php mailtest.php" on the command line, the email gets sent correctly, but if I browse to server.com/mailtest.php, mail() returns false and the email never gets sent. Nothing appears in the exim mainlog.

Any advice, or things I should look for ?

Thanks!

share|improve this question
    
What distro? Are you running in an SELinux-protected configuration? –  jgoldschrafe Nov 8 '10 at 12:01
    
@jgoldschrafe Debian 5.0.6 and no. –  jfoucher Nov 25 '10 at 19:09

1 Answer 1

It sounds like you've got different versions of php.ini located under /etc/php5/

debian:/etc/php5# find . | grep php.ini
./cli/php.ini
./apache2/php.ini

Check the [mail function] directive

share|improve this answer
    
I did, they're the same in both files. I actually copied one to the other (and the other way around) and got the exact same results –  jfoucher Nov 25 '10 at 19:11
    
Do a phpinfo() and add the php server information "sendmail" to your question. Exim will normally replace the sendmail binary with the send compartible exim binary. –  DrDol Dec 28 '10 at 22:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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