nginx php-fpm 配置问题(1)
1.问题 Nginx/FPM/PHP all php files say 'File not found.'
nginx error日志:
[error] 20277#0: *21 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1,
解决:
修改nginx.conf配置
location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_intercept_errors on; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; //修改下面这个配置,默认配置为 //fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; //--> 改成下面这样 $document_root为root配置的值 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
参考:
[nginx-1.4.3识别fastCGI报错 Primary script unknown](http://lovelace.blog.51cto.com/1028430/1314565)
[nginx File not found 错误] http://www.nginx.cn/562.html
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:nginx php-fpm 配置问题(1) - Python技术站