nginx and fastcgi - unable to serve PHP

sekatsim nginx-forum at
Wed Jan 6 18:49:06 MSK 2010

I've been working on this for about two days now, still with no luck, and I'm about out of ideas. Any suggestions would be much appreciated.

I've got a working install of nginx (serves HTML fine), installed php5 and followed the instructions at to get php working. I've been using the shell script from to start php.

ps ax | grep php
 1899 ?        Ss     0:00 /usr/bin/php5-cgi -q -b
 1901 ?        S      0:00 /usr/bin/php5-cgi -q -b
 1902 ?        S      0:00 /usr/bin/php5-cgi -q -b
 1903 ?        S      0:00 /usr/bin/php5-cgi -q -b
 1904 ?        S      0:00 /usr/bin/php5-cgi -q -b
 1905 ?        S      0:00 /usr/bin/php5-cgi -q -b
 1975 pts/1    R+     0:00 grep --color=auto php

(php is running and listening on port 9000)

In my nginx server config, I have:

        location ~ \.php$ {
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/mysite$fastcgi_script_name;
            include        /opt/nginx/conf/fastcgi_params;

However, on loading, I get a page that reads:  "The page you are looking for is temporarily unavailable. Please try again later."

nginx's error.log reads:

2010/01/06 10:34:20  1936#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client:, server:, request: "GET / HTTP/1.1", upstream: "fastcgi://", host: ""

Everything seems to be set correctly, at least as much as I've read, yet I still can't get it to work. Any idea what I might be doing wrong?

Thank you

Posted at Nginx Forum:,37682,37682#msg-37682

More information about the nginx mailing list