PHP with FPM on Gentoo

locojohn nginx-forum at nginx.us
Tue Apr 3 08:02:14 UTC 2012


Hi,

Do you actually get any content, apart from errors in nginx error_log?  
The message "client closed prematurely connection while reading client
request line, client: ..." shouldn't be a problem itself.

"Some modern browsers tend to open 2 tcp connections to server from
start, and if you are loading a single static file - one of them remains
unused.  The browser eventually closes it without sending any request,
and this causes the above message in logs." - Maxim Dounin.

I can see from your access_log that requests are processed normally and
responses are OK (code 200) for all your files including PHP files
(request: /info.php).  

You can also use sockets for fastcgi connections, but that's a matter of
preference and probably won't solve your issue, which I do not fully
understand yet.

shell:

mkdir -p /var/run/fastcgi/php-fpm.sock

php-fpm.conf:

;listen = 127.0.0.1:9000
;listen.allowed_clients = 127.0.0.1
listen = /var/run/fastcgi/php-fpm.sock
listen.owner = nginx
listen.group = nginx

nginx.conf:

location \.php$ {
  include fastcgi_params;
  fastcgi_pass unix:/var/run/fastcgi/php-fpm.sock;
}

Andrejs

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



More information about the nginx mailing list