nginx下访问PHP文件File not found错误解决办法

nginx配置完成后,浏览器打开php文件就提示File not found.错误。html文件可以访问,问题错误原因:

fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;

改成如下这句,即可

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

server {

listen 80;

server_name *.example.com;

root /home/nginx/vhosts/example.com/web;

location / {

index index.php;

}

location ~ \.php$ {

root /home/nginx/vhosts/example.com/web;

fastcgi_pass 127.0.0.1:9001; fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include /etc/nginx/fastcgi_params;

}

}

 

http://www.xuebuyuan.com/2174288.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>