Welcome! Log In Create A New Profile

Advanced

mail() function works from php command line but not from php-fpm (nginx server)

Posted by khizar 
mail() function works from php command line but not from php-fpm (nginx server)
May 07, 2011 12:44AM
hello guys

somehow mail() function works on php command line but not from php-fpm
(nginx server)

m using sendmail and php configuration are also correct and m using
same php configuration file

anyone have any idea to resolve this issue

thanx in advance
Check /var/log/maillog (or whatever your mail log is called) for any errors
(or to at least verify an attempt to mail is made).
Show us any errors from your PHP error log as well.

Also, is your FPM install chroot'd? That may cause such an issue.

On Sat, May 7, 2011 at 12:42 AM, myuniverso.com <khizarsonu@gmail.com>wrote:

> hello guys
>
> somehow mail() function works on php command line but not from php-fpm
> (nginx server)
>
> m using sendmail and php configuration are also correct and m using
> same php configuration file
>
> anyone have any idea to resolve this issue
>
> thanx in advance
bro. i have check both log file php_errors.log and /var/log/maillog
but no error is showed there and php error log is also enabled

please any1 help me

On May 6, 9:48 pm, Jonathan Langevin <intel...@gmail.com> wrote:
> Check /var/log/maillog (or whatever your mail log is called) for any errors
> (or to at least verify an attempt to mail is made).
> Show us any errors from your PHP error log as well.
>
> Also, is your FPM install chroot'd? That may cause such an issue.
>
> On Sat, May 7, 2011 at 12:42 AM, myuniverso.com <khizars...@gmail.com>wrote:
>
>
>
>
>
>
>
> > hello guys
>
> > somehow mail() function works on php command line but not from php-fpm
> > (nginx server)
>
> > m using sendmail  and php configuration are also correct and m using
> > same php configuration file
>
> > anyone have any idea to resolve this issue
>
> > thanx in advance
Does the mail log at least show an attempt to send the email?
On May 7, 2011 1:10 AM, "myuniverso.com" <khizarsonu@gmail.com> wrote:
> bro. i have check both log file php_errors.log and /var/log/maillog
> but no error is showed there and php error log is also enabled
>
> please any1 help me
>
> On May 6, 9:48 pm, Jonathan Langevin <intel...@gmail.com> wrote:
>> Check /var/log/maillog (or whatever your mail log is called) for any
errors
>> (or to at least verify an attempt to mail is made).
>> Show us any errors from your PHP error log as well.
>>
>> Also, is your FPM install chroot'd? That may cause such an issue.
>>
>> On Sat, May 7, 2011 at 12:42 AM, myuniverso.com <khizars...@gmail.com
>wrote:
>>
>>
>>
>>
>>
>>
>>
>> > hello guys
>>
>> > somehow mail() function works on php command line but not from php-fpm
>> > (nginx server)
>>
>> > m using sendmail and php configuration are also correct and m using
>> > same php configuration file
>>
>> > anyone have any idea to resolve this issue
>>
>> > thanx in advance
no it does not show..


On May 6, 11:26 pm, Jonathan Langevin <intel...@gmail.com> wrote:
> Does the mail log at least show an attempt to send the email?
> On May 7, 2011 1:10 AM, "myuniverso.com" <khizars...@gmail.com> wrote:
>
>
>
>
>
>
>
> > bro. i have check both log file php_errors.log and /var/log/maillog
> > but no error is showed there and php error log is also enabled
>
> > please any1 help me
>
> > On May 6, 9:48 pm, Jonathan Langevin <intel...@gmail.com> wrote:
> >> Check /var/log/maillog (or whatever your mail log is called) for any
> errors
> >> (or to at least verify an attempt to mail is made).
> >> Show us any errors from your PHP error log as well.
>
> >> Also, is your FPM install chroot'd? That may cause such an issue.
>
> >> On Sat, May 7, 2011 at 12:42 AM, myuniverso.com <khizars...@gmail.com
> >wrote:
>
> >> > hello guys
>
> >> > somehow mail() function works on php command line but not from php-fpm
> >> > (nginx server)
>
> >> > m using sendmail  and php configuration are also correct and m using
> >> > same php configuration file
>
> >> > anyone have any idea to resolve this issue
>
> >> > thanx in advance
Try with phpinfo() from both php (CLI and FPM) and compare the value of
the sendmail_path directive.

Also, make sure sendmail is in your PATH and that you haven't altered
the following int /usr/local/etc/php/php-fpm.conf
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f
www@my.domain.com

Regards

On 05/07/2011 01:42 AM, myuniverso.com wrote:
> hello guys
>
> somehow mail() function works on php command line but not from php-fpm
> (nginx server)
>
> m using sendmail and php configuration are also correct and m using
> same php configuration file
>
> anyone have any idea to resolve this issue
>
> thanx in advance
A suggestion:

Attach strace to your process (strace -p <pid>) and watch the output. If you
have a lot of child processes see if you can restart it with on child.
(strace -f -<pid> will follow forked processes).

strace in invaluable for showing up issues around missing files/libs & bad
directories and especially insidious permission problems. These days it's
all I need to point me in the right direction for problems like you are
having.

Dave.


On Sat, May 7, 2011 at 6:16 PM, Juan Fco. Giordana
<juangiordana@gmail.com>wrote:

> Try with phpinfo() from both php (CLI and FPM) and compare the value of the
> sendmail_path directive.
>
> Also, make sure sendmail is in your PATH and that you haven't altered the
> following int /usr/local/etc/php/php-fpm.conf
> ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f
> www@my.domain.com
>
> Regards
>
>
> On 05/07/2011 01:42 AM, myuniverso.com wrote:
>
>> hello guys
>>
>> somehow mail() function works on php command line but not from php-fpm
>> (nginx server)
>>
>> m using sendmail and php configuration are also correct and m using
>> same php configuration file
>>
>> anyone have any idea to resolve this issue
>>
>> thanx in advance
>>
>
>
Hi!

Khizar, did you manage to solve the problem? What was the reason? I have the exact same problem as you and am wondering if you could share your solution.

Thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 290
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready