nginx+php部署FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream错误

时间:2020-04-02 11:06:39   收藏:0   阅读:129

部署zabbix的lnmp环境时,测试php页面打不开,查看nginx的errorlog日志,报错FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream,

1、网上查询有修改nginx.conf的,如下

fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
修改为
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

然后执行service nginx reload 或者service nginx restart 或者进入/etc/init.d/nginx  restart

笔者是修改上面这个配置就解决了。

2、部分有说是php-fpm中user和group未指定nginx为其用户的。(我的配置里已提前指定过,所以排除这个原因,没配置的同学可以试试)

编辑php-fpm的配置
vi /usr/local/php/etc/php-fpm.conf 

大概在149行

技术分享图片

 

 配置完检查进程ps -ef | grep php

技术分享图片

 

原文:https://www.cnblogs.com/chxmtl/p/12617671.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!