atom feed19 messages in ru.sysoev.nginxRe: Nginx + PHP FASTCGI FAILS - how t...
FromSent OnAttachments
NiroJan 12, 2010 10:05 am 
merlin coreyJan 12, 2010 4:45 pm 
war59312Feb 11, 2010 8:12 pm 
Daniel HahlerFeb 12, 2010 5:20 am 
Reinis RozitisFeb 12, 2010 6:07 am 
Piotr KarbowskiFeb 12, 2010 6:13 am 
shaktaleFeb 12, 2010 10:29 am 
UsuApr 3, 2010 7:23 pm 
Payam ChychiApr 3, 2010 7:36 pm 
jjjx128Apr 3, 2010 8:08 pm 
UsuApr 4, 2010 12:55 am 
unclepiemanApr 4, 2010 11:37 am 
UsuApr 4, 2010 11:59 am 
unclepiemanApr 4, 2010 12:19 pm 
UsuApr 4, 2010 12:21 pm 
Don BurrisJun 20, 2010 2:28 pm 
franky gmanAug 11, 2011 10:05 am 
Volodymyr KostyrkoAug 11, 2011 10:25 am 
Reinis RozitisAug 12, 2011 4:31 am 
Subject:Re: Nginx + PHP FASTCGI FAILS - how to debug ?
From:Don Burris (lis@ruby-forum.com)
Date:Jun 20, 2010 2:28:35 pm
List:ru.sysoev.nginx

Usu wrote:

Hi, I'm having the same problem for a few weeks now, after x hours/days php becomes unresponsive, I've already changed 2 different php-fastcgi spawning scripts and tried php-fpm as well, switched between many version of the php 5.2 and 5.3 branches but the problem still remains so I don't think it's a php issue even if that would be the most logical conclusion.

When php becomes unresponsive (502 bad gateway error) all the php-cgi/php-fpm processes are still running and I can see them in top/ps aux, when I restart php everything start to work again.

I don't know if it's releated, but while I was browsing this forum a few minutes ago I got the 502 error with the same behavior it has when it happens on my site, it lasted some minutes than someone took care of it. Also, take a look at this discussion: http://groups.google.com/group/highload-php-en/browse_thread/thread/a3809a50eba71a45 I think that this is a nginx bug, it would be nice if some developer could look into this, I could provide error logs and such if needed, just let me know, thanks!

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,40332,70942#msg-70942

I realize you may have moved on; some time has passed since you posted this problem. However, I had the same issue and I was able to fix it. The user nginx runs as in a default setup is "www-data", or "nobody". Nginx has insufficient permissions to communicate with fastcgi://127.0.0.1:9000 which usually runs as root. So if you use spawn-fcgi, you must run it with the -U flag, and specify the same user that nginx runs as. For example:

spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -f /usr/bin/php-cgi -U nobody

or if you use sockets

spawn-fcgi -s /var/run/fcgi.sock -C 5 -f /usr/bin/php-cgi -U nobody

My problem was identical to yours, php would work for a moment, then become unresponsive even though the processes were still running. I hope this helps, this problem was very frustrating.