PHP with FPM on Gentoo

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


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.


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


;listen =
;listen.allowed_clients =
listen = /var/run/fastcgi/php-fpm.sock
listen.owner = nginx = nginx


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


Posted at Nginx Forum:,224804,224821#msg-224821

More information about the nginx mailing list