nginx and fastcgi - unable to serve PHP

Maxim Dounin mdounin at mdounin.ru
Thu Jan 7 02:46:52 MSK 2010


Hello!

On Wed, Jan 06, 2010 at 10:49:06AM -0500, sekatsim wrote:

> 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 http://www.allthepages.org/archives/2009/02/how-get-drupal-working-nginx to get php working. I've been using the shell script from http://drupal.org/node/110224 to start php.
> 
> ps ax | grep php
>  1899 ?        Ss     0:00 /usr/bin/php5-cgi -q -b 127.0.0.1:9000
>  1901 ?        S      0:00 /usr/bin/php5-cgi -q -b 127.0.0.1:9000
>  1902 ?        S      0:00 /usr/bin/php5-cgi -q -b 127.0.0.1:9000
>  1903 ?        S      0:00 /usr/bin/php5-cgi -q -b 127.0.0.1:9000
>  1904 ?        S      0:00 /usr/bin/php5-cgi -q -b 127.0.0.1:9000
>  1905 ?        S      0:00 /usr/bin/php5-cgi -q -b 127.0.0.1:9000
>  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_pass   127.0.0.1:9000;
>             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: 192.168.2.4, server: mysite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.2.16"

This usually means that php process died.  It may be caused by 
various things (e.g. wrong php extension order) but it's not 
really relevant to this list.

Maxim Dounin



More information about the nginx mailing list