Home  >  Article  >  Backend Development  >  nginx服务器上访问不存在的php页面No input file specified

nginx服务器上访问不存在的php页面No input file specified

WBOY
WBOYOriginal
2016-06-13 13:11:40839browse

nginx服务器下访问不存在的php页面No input file specified.
在nginx/conf/nginx.conf   找到:
fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  改为:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


http://apps.hi.baidu.com/share/detail/31677987
http://www.oschina.net/question/57933_27069




nginx服务器下访问不存在的非php页面,可以正常出现自定义的404提示页,但是访问不存在的php页面,页面信息显示 nginx服务器上访问不存在的php页面No input file specified
初步估计是fastcgi没把错误给Nginx
查了下nginx的文档 果然

fastcgi_intercept_errors
syntax: fastcgi_intercept_errors on|off
default: fastcgi_intercept_errors off
context: http, server, location 
默认的是off

只需在虚拟主机配置文件加入:
fastcgi_intercept_errors on;

即可。我配置了error_page 404,没有使用nginx默认的404提示页面。
效果图:
 nginx服务器上访问不存在的php页面No input file specified


配置文件里面的编写
 nginx服务器上访问不存在的php页面No input file specified

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn