File Not Found when running PHP with Nginx

后端 未结 15 1938
后悔当初
后悔当初 2020-12-04 13:59

Recently I installed the latest version of Nginx and looks like I\'m having hard time running PHP with it.

Here is the configuration file I\'m using for the domain:<

相关标签:
15条回答
  • 2020-12-04 14:55

    Probably it's too late to answer but a couple things since this is a really annoying error. Following solution worked on Mac OS X Yosemite.

    1. It's the best if you have

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    1. The include with fast cgi params should go above that line.

    2. All your directories down to the PHP file you're executing (including that file too) should have a+x permissions, e.g.

    sudo chmod a+x /Users/
    sudo chmod a+x /Users/oleg/
    sudo chmod a+x /Users/oleg/www/
    sudo chmod a+x /Users/oleg/www/a.php
    
    0 讨论(0)
  • 2020-12-04 14:55

    When getting "File not found", my problem was that there was no symlink in the folder where was pointing this line in ngix config:

    root /var/www/claims/web;
    
    0 讨论(0)
  • 2020-12-04 14:57

    in case it helps someone, my issue seems to be just because I was using a subfolder under my home directory, even though permissions seem correct and I don't have SELinux or anything like that. changing it to be under /var/www/something/something made it work.

    (if I ever found the real cause, and remember this answer, I'll update it)

    0 讨论(0)
提交回复
热议问题