Access denied (403) for PHP files with Nginx + PHP-FPM

后端 未结 7 1693
孤街浪徒
孤街浪徒 2020-12-13 04:58

I have been spending few hours on that issue and despite the high number of posts related to it, I cannot solve it. I have a Fedora 20 box with Nginx + PHP-FPM that worked q

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 05:05

    Please note that the above solution (set cgi.fix_pathinfo to 1) is a terrible idea. See https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/ for a good overview.

    The issue is probably down to your application relying on PATH_INFO. Enable access logging for php to get more information about how your application is called to help you debug this issue.

    Once again, just to be sure - the accepted solution is a terrible idea, and will likely get your site hacked.

提交回复
热议问题