nginx+php遇到的一个问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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遇到的一个问题的主要内容,如果未能解决你的问题,请参考以下文章