久久青草精品A片狠狠,日韩欧美视频一区二区,亚洲国码AV日韩,国产精品黄在

幫助中心 >  技術知識庫 >  云服務器 >  服務器教程 >  nginx FastCGI錯誤Primary script unknown解決辦法

nginx FastCGI錯誤Primary script unknown解決辦法

2019-09-04 09:20:28 10555

在centos上成功編譯安裝nginx 1.4、php 5.4并成功啟動nginx和php-fpm后,訪問php提示"File not found.",同時在錯誤日志中看到:


2013/10/22 20:05:49 [error] 12691#0: *6 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.168.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.168.133"


解決方法:

在Nginx配置文件中找到定義調用腳本文件的地方,如:



fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;


修改成如下方式($document_root):


fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

提示:

$document_root 代表當前請求在root指令中指定的值。如:



location / {

       root   /usr/local/nginx/html;

       index  index.php index.html index.htm;

       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

上面配置中的$document_root就是針對/usr/local/nginx/html目錄下的php文件進行解析。


提交成功!非常感謝您的反饋,我們會繼續努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務,我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: