Finally fixed it.
The culprit was this line in my config:
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
If I commented this line, everything worked fine. However I saw this in almost every post I read about Nginx configs, so it bothered me. When looking at my configs for the millionth time, I saw that cgi.fix_pathinfo
(in php.ini
) was set to 0, where it should have been 1. The default value PHP uses is also 1, so I must have changed this in my debugging hours, because I remember reading about this value, and thought it was set correct.
Anyway, maybe it helps anyone Googling for this issue.
manpreet
Best Answer
2 years ago
I'm trying to set up a freshly installed Ubuntu (12.04) server, but I can't get PHP files running through php-fpm. No matter what I do, I always get a "Access denied." page (plain text, not html or anything).
Installed packages:
Configuration details:
PHP-FPM:
Nginx:
Default/test domain:
/extra/htdocs/default/index.php:
Everything else is default. Both the Nginx and php-fpm logs show no errors. Yet when I load
http:///index.php
I get the "Access denied" page.Troubleshooting:
/extra
directory towww-data
, and ownership to 777, just to be sure (I'll tone it down once it works of course). So it's certainly not a permissions issue.php .html
, with the same result.I'm really getting tired of this, I've installed this setup twice already (albeit on OSX machines), and everything worked flawlessly. Is there anything I'm overlooking?
The log contents:
The Nginx error log is empty.
Nginx access log (removed ip):
php-fpm log: