慕容的工作随笔

慕容的工作随笔

记录学习和工作

nginx运行出现 file not found 错误处理原因

在阿里云装nginx+php+mysql nginx运行出现 file not found 错误处理原因

1,第一情况

location ~ .php$ {

root html;

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;这里改为 $document_root

2,第二情况

server {
listen 80;
server_name v1.ywwfx.com;
root /home/www/www.96net.com.cn;

}

root /home/www/www.96net.com.cn;目录权限不够导致的

3,第三种情况

vim /etc/php-fpm.d/www.conf

user=nginx

group=nginx

这些都设置后  重启nginx  php-fpm 就可以运行了

 

我是第一种 安装好nginx之后,原配置是:

location ~ .php$ {

root html;

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /script_name$fastcgi_script_name;
include fastcgi_params;
}

修改为$document_root$fastcgi_script_name;就可以了

评论 (0)

还没有评论,来做第一个吧。

发表评论

提交后需管理员审核通过后显示