当使用Nginx运行PHP时找不到文件

最近我安装了最新版本的Nginx,看起来像我很难用它运行PHP。

这里是我用于域的配置文件:

server {
listen       80;
server_name  localhost;

location / {
    root   /usr/share/nginx/html;
    index  index.php;
}

error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}

location ~ \.php$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    include        fastcgi_params;
}

}}

这是我得到的错误日志文件中的错误:

FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
尝试另一个* fastcgi_param *类似

fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
http://stackoverflow.com/questions/17808787/file-not-found-when-running-php-with-nginx

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:当使用Nginx运行PHP时找不到文件