How to setup nginx to make php works in site subdirectories

Francis Daly francis at
Sun Feb 12 21:52:32 UTC 2012

On Sun, Feb 12, 2012 at 03:28:03PM -0500, dimentiy wrote:

Hi there,

> I'm quite stupid... I entirly can't think... There was <? ?> short tags
> disabled, all the scripts use short tags, but only the one I tested
> locating in root directory had <?php long tag... because I write it 

Congratulations on finding that that was the problem.

Now that we know the answer, is there any way it could have been found
earlier? This could help the next person who has a similar problem and
is searching the mailing list archive.

I think that

  curl -i

would show the "X-Powered-By: PHP" header which indicates that the file
was handled by php (even if it was just a pass-through): and copying
new.php to new.txt and trying

  curl -i

would show the same content but without the PHP header line.

Maybe that would point to the php configuration as being the next place
to look.

All the best,

Francis Daly        francis at

More information about the nginx mailing list