最近我安装了最新版本的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;
}
}
下面是我在错误日志(log)文件中看到的错误:
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream