problems with php-fpm

mike mike503 at gmail.com
Wed Aug 27 04:24:11 MSD 2008


do you have a log from php-fpm?

also you can throw this in fastcgi_params, so you don't have to define
it in each server block.

fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;

oh yeah - and fastcgi params can be included globally in http {} block
doesn't need to be in each server/location block.

also i believe fastcgi_index can be removed completely.

those are just config cleanups - i don't think it will help. from
looking at it quick it looks like you've got it setup right. can you
telnet to 127.0.0.1 9000 and get a response? i'd assume so, or it
would get connection refused...



On 8/26/08, Samuel Vogel <samydelux at gmail.com> wrote:
> Hey guys,
>
> I am new to nginx an I am trying to set up nginx with php support through
> php-fpm.
> When I start php-fpm, it does spawn some php processes:
> # ps aux | grep php
> root     30292  0.0  0.0  11852  2752 ?        Ss   Aug26   0:00
> /usr/bin/php-cgi --fpm --fpm-config /etc/php5/php-fpm.conf
> www-data 30296  0.0  0.0  11900  2460 ?        S    Aug26   0:00
> /usr/bin/php-cgi --fpm --fpm-config /etc/php5/php-fpm.conf
> www-data 30297  0.0  0.0  11900  2460 ?        S    Aug26   0:00
> /usr/bin/php-cgi --fpm --fpm-config /etc/php5/php-fpm.conf
>
> This seems about right, ain't it?
> I have configured nginx with the standart config, that comes with the debian
> package (0.6.32). My fastcgi conf looks like this:
>       location ~ \.php$ {
>               fastcgi_pass   127.0.0.1:9000;
>               fastcgi_index  index.php;
>               fastcgi_param  SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
>               include fastcgi_params;
>       }
>
>
> # cat /etc/nginx/fastcgi_params
> fastcgi_param  QUERY_STRING       $query_string;
> fastcgi_param  REQUEST_METHOD     $request_method;
> fastcgi_param  CONTENT_TYPE       $content_type;
> fastcgi_param  CONTENT_LENGTH     $content_length;
>
> fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
> fastcgi_param  REQUEST_URI        $request_uri;
> fastcgi_param  DOCUMENT_URI       $document_uri;
> fastcgi_param  DOCUMENT_ROOT      $document_root;
> fastcgi_param  SERVER_PROTOCOL    $server_protocol;
>
> fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
> fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
>
> fastcgi_param  REMOTE_ADDR        $remote_addr;
> fastcgi_param  REMOTE_PORT        $remote_port;
> fastcgi_param  SERVER_ADDR        $server_addr;
> fastcgi_param  SERVER_PORT        $server_port;
> fastcgi_param  SERVER_NAME        $server_name;
>
> # PHP only, required if PHP was built with --enable-force-cgi-redirect
> #fastcgi_param  REDIRECT_STATUS    200;
>
>
> Unfortunately I get an 50x error and the following is written to the
> error.log:
> 2008/08/27 00:51:00 [error] 26403#0: *1 recv() failed (104: Connection reset
> by peer) while reading response header from upstream, client: xx.xx.xx.xx,
> server: localhost, request: "GET /index.php HTTP/1.1", upstream:
> "fastcgi://127.0.0.1:9000", host: "xx.xx.xx.xx"
>
> Searching the web I found out, that this error relates to
> FCGI_WEB_SERVER_ADDRS not being set properly, but it is in my case:
> <value name="allowed_clients">127.0.0.1</value>
>
> php should also be listening on the right port:
> <value name="listen_address">127.0.0.1:9000</value>
>
> Does anybody have any hints for a nginx beginner?
>
> Regards,
> Samy
>
>





More information about the nginx mailing list