I've an issue with using nginx with fastcgi. It just runs for few requests and then it hangs/dies or whatever. Nginx then just returns bad gateway (502).
This is the code I used to spawn fastcgi:
FASTCGI_USER=www-data
FASTCGI_GROUP=www-data
ADDRESS=127.0.0.1
PORT=8080
PIDFILE=/var/run/php-fastcgi/php-fastcgi.pid
CHILDREN=4
PHP5=/usr/bin/php5-cgi
/usr/bin/spawn-fcgi -a $ADDRESS -p $PORT -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP -f $PHP5
I'm on Debian Squeeze. Any idea what could be wrong why it happens like this? When I kill all the fastcgi processes and run this script again, everything works for few requests and hangs again..