php-fpm works with some sites but not others?

Francis Daly francis at
Mon May 28 18:13:38 UTC 2012

On Mon, May 28, 2012 at 05:07:46PM +0100, Adrian Hayter wrote:

Hi there,

> Everything was working perfectly, until for some reason one site just
> failed to show anything.
> I made sure the permissions were correct, and the nginx config file hasn't
> changed. One bizarre thing is that a call to phpinfo() returns "File not
> found", but I can't seem to find a fix for this online.

A frequent response from nginx for a "broken" php setup is "HTTP/1.1
404 Not Found", with a header indicating "X-Powered-By: PHP", and a body
content of "No input file specified."

A frequent reason for this is that the SCRIPT_FILENAME fastcgi param
sent by nginx to the fastcgi server does not identify a file that the
fastcgi server is able to access.

(Different fastcgi servers may use different param names to identify
the file.)

If you examine your nginx config for the server and location which handles
a working request, you may be able to determine what SCRIPT_FILENAME is
set to. Do the same for the server and location of a failing request,
and you may see the relevant difference.

Alternatively, if you enable the debug log, you'll see something like

  fastcgi param: "SCRIPT_FILENAME: /usr/local/nginx/html/php"

which will show you exactly what it is set to for your requests (as well
as all of the other params that are set).

Maybe that will help you spot the difference between a working request
and a failing one.

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list