我正在尝试在nginx上设置symfony。 以下是配置 -
upstream phpfcgi {
server 127.0.0.1:9000;
# server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}
server{
listen 80;
server_name xxy.xxy.com;
root /home/abcdef/website/current/web;
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
# rewrite all to app.php
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass phpfcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
我收到此错误
2013/12/12 11:23:55 [error] 25515#0: *5 upstream sent unsupported FastCGI protocol version: 60 while reading response header from upstream, client: 111.84.98.65, server: xxy.xxy.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "xxy.xxy.com"
有人可以帮我吗?
答案 0 :(得分:1)
检查
netstat -tap
查看另一个应用程序是否正在侦听端口9000.如果是,请尝试将其删除
kill -l PID
或更改nginx配置中的端口。当配置的端口已被使用时,通常会发生错误。
答案 1 :(得分:0)
当我也遇到这个问题时,我必须做一个服务器配置,根据我的经验,我更喜欢使用 unix 套接字来尝试释放 NAT,另一方面要运行它需要在之前安装 fpm,做一些事情像这样:
sudo apt install php5.3-fpm
该数据包不包含在 phpX-common 安装中,谢谢。