【求助】关于Nginx配置php访问 fastcgi_param 的问题

回复 收藏

有问题的配置:

server

{

        listen 808;

        server_name localhost;

        index index.php index.html index.htm;

        root /export/web/exchange;

        location ~.*\.php$ {

                #fastcgi_pass unix:/tmp/php-fcgi.sock;

                fastcgi_pass 127.0.0.1:9000;

                fastcgi_index index.php;

                #fastcgi_param SCRIPT_FILENAME /export/web/exchange$fastcgi_script_name;

                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

                include fastcgi_params;

        }   

}

正常的配置:

server

{

        listen 809;

        server_name localhost;

        index index.php index.html index.htm;

        root /export/web/a;

        location ~.*\.php$ {

                include fastcgi_params;

                #fastcgi_pass unix:/tmp/php-fcgi.sock;

                fastcgi_pass 127.0.0.1:9000;

                fastcgi_index index.php;

                #fastcgi_param SCRIPT_FILENAME /export/web/aaaa$fastcgi_script_name;

                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

                #include fastcgi_params;

        }           

}

错误日志:2017/03/30 12:40:17 [error] 11047#0: *155 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.68.1, server: localhost, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.68.111:808" 

808端口的 /export/web/exchange 是共享文件夹 (df -h  查看 //192.168.68.1/exchange        87G   30G   57G  35% /export/web/exchange)

Nginx 本身能够访问 比如 a.txt 在url中能够正常访问。

使用Apache 搭配Php 时本机共享也可以正常使用 。 

实在不理解到底问题出在哪里了?

2017-05-30 18:06 举报
已邀请:

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: