Re: php mail function not work from apache,but work well from command line

From: Date: Sat, 22 Aug 2015 16:19:15 +0000
Subject: Re: php mail function not work from apache,but work well from command line
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-325051@lists.php.net to get a copy of this message
> Date: Saturday, August 22, 2015 09:51:45 -0400 > From: Aziz Saleh <azizsaleh@gmail.com> > > On Sat, Aug 22, 2015 at 5:50 AM, Xinhao Zheng > <xinhaozheng@gmail.com> wrote: > >> Hello, >> >> i got a prolem.php mail() function can not send email from >> http request(apache),but it work well if i call it from >> command line. >> >> /usr/local/php5.3.28/bin/php test_mail.php => ok >> http://ip/test_mail.php => failed. >> >> i check both apache error log and /var/log/maillog,but nothing >> get there. i am running php5.3.28 over apache as module. with >> phpinfo and this command, >> /usr/local/php5.3.28/bin/php --ini , i am sure they use same php >> config file.i also tried to turn off the iptable,but no lucky >> shot. >> >> >> > Use phpinfo() to confirm they are using the same configs. Are you accessing the same "test_mail.php" page/code in both cases? If so, I really wouldn't expect it to work as the environments are totally different. Show your code. By the way, if you aren't generating a message (nothing in /var/log/maillog) then mucking with iptables will have no effect.

« previous php.general (#325051) next »