nginx File not found

出现 nginx File not found 错误 首先判断这个文件是否 真的存在 如果文件确实存在 那么应该是 php-fpm 路径有问题了

解决办法

1查看 php-fpm 的配置文件 我的 文件位置在  /etc/php-fpm.d/www.conf 中 这里有个 listen  查看一下 这个后面的参数要与 nginx 中的 配置文件的路径保持一直 比如 127.0.0.1:9000

2配置 nginx  

location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;#注意这里
        include fastcgi_params;
    }

然后 别忘记 重启 php-rpm 与 nginx服务

3 如果错误依然存在 可以查看一下 你的站点目录 有没有可执行权限 chmod 777 试试

我就 遇见过 第3部出了问题 卡住了好几个小时 后来才发现没有增加 可执行权限

 

posted @ 2016-05-27 11:01  西海  阅读(190)  评论(0编辑  收藏  举报