首页 > 代码库 > nginx+php遇到的一个问题
nginx+php遇到的一个问题
问题描述:今天在安装nginx+php的时候遇到一个以前遇到的问题,由于时间太长忘了。导致折腾半天。。特此记录。访问html页面正常,php页面报错。
nginx错误日志:
2016/10/24 17:27:56 [error] 11469#0: *4 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 114.251.70.50, server: 101.201.121.205:808, request: "GET /pma/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "101.201.121.205:808" 2016/10/24 17:29:50 [error] 11469#0: *11 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 114.251.70.50, server: 101.201.121.205:808, request: "GET /pma/main.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "101.201.121.205:808" 2016/10/24 17:40:17 [error] 11469#0: *14 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 114.251.70.50, server: 101.201.121.205:808, request: "GET /pma/main.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "101.201.121.205:808"
页面错误截图:
解决办法:
编辑nginx主配置文件,修改此行
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
替换成
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
参考文章:
http://lovelace.blog.51cto.com/1028430/1314565
本文出自 “初心、始终” 博客,请务必保留此出处http://gouyc.blog.51cto.com/1594451/1865137
nginx+php遇到的一个问题
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。