LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   PHP mail() cease to work (https://www.linuxquestions.org/questions/linux-server-73/php-mail-cease-to-work-851613/)

bombshell 12-21-2010 11:08 AM

PHP mail() cease to work
 
I'm shell admin of http://bombshellnet.org and I'm in charge of the site. I was writing new code and testing it on the server when I encountered a unusual issue, mail() just cease to work without any useful explanation to as why. I've increase debug level in HTTPD, Postfix, and in PHP but no errors relating to this issue are logged. There's no indication in Postfix that PHP within Apache is making any attempts to send Mail. I've tested the Postfix with my E-Mail client, Telnet, and sendmail and all have passed. I test sample code on the cli with PHP and that has also passed. However, within Apache this test fails. I would include logs but there aren't any useful information. I read on another forum that this might be related to PHP misconfiguration of the send mail binary, but that's not the case as I double checked for accuracy. I'm not sure if anyone can provide helpful hints to this issue without much data to go on but I'm asking at anyrate. Anyone have any ideas?

Noway2 12-21-2010 11:37 AM

Did you recently upgrade or update your PHP? It was a couple of months ago, but I recall something about mail getting broken in php5.3. It may have been Ubuntu related, but I am not certain. I recall the problem because I upgraded and could no longer send mail on the development/test PC I was using and I ended up downgrading the package.

bombshell 12-21-2010 12:47 PM

Unfortunately, we currently using Fedora 14 and they only have the latest PHP 5.3.3 in the Repos. At this point, we don't have any other information to go on, I'm going to submit a bug. I'm not sure what I've done specifically for the function to cease working since it worked a couple of days ago :\

Dani1973 12-21-2010 12:55 PM

Are the setting in php.ini correct ???

I had the same problem once, everything just worked and then after a upgrade it suddenly stopped working and I had to correct my php.ini

bombshell 12-21-2010 01:33 PM

I removed PHP and reinstalled it with the default settings and still no go. It has to be something up with Apache... :/ I'm going to try one more thing and see....

bombshell 12-21-2010 01:36 PM

Here is a bug report that I submitted to fedora: https://bugzilla.redhat.com/show_bug.cgi?id=664825 .... I even upgraded to testing PHP 5.3.4 and still no go =]

bombshell 12-21-2010 01:56 PM

After screwing around, I found out that php has a mail.log feature. I enabled it and got this:

Quote:

mail() on [/var/www/html/mail.php:9]: To: bombshell@bombshellnet.org -- Headers:

bombshell 12-21-2010 02:26 PM

Alright, I retrieve a script which I modified http://www.howtoforge.com/how-to-log...tect-form-spam and have it logged when it's called. PHP is not calling the script at all nor do I see sendmail errors in /var/log/maillog

bombshell 12-21-2010 03:11 PM

Alright, this issue has been solved. Took me nearly 8 hours to fix but the issue was created by me in attempt to lock down bash. I prevented Apache from running shell commands. After scoring the web with helpful tips that guided me to this issue, I don't how know I could think google.com and linux questions. Hopefully this can be helpful for the next person =]


All times are GMT -5. The time now is 06:14 PM.