Reputation: 1044
I am trying to setup symfony on nginx. Below are the configuration -
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;
}
I am getting this error
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"
Can somebody help me on this?
Upvotes: 2
Views: 15276
Reputation: 3256
php-fpm and nginx need to be listening on different ports for starters, and then nginx's fastcgi_pass needs to point at the php-fpm port.
Upvotes: 0
Reputation: 1
I have to do a server config when that issues to me too, in my experience I prefer to use a unix socket in a try to free the NAT, in another hand to run this is need to install fpm before, doing something like this:
sudo apt install php5.3-fpm
that packet isn't included in phpX-common install, thank you.
Upvotes: 0
Reputation: 70426
Check
netstat -tap
to see if another application is listening on port 9000. If so try to kill it
kill -l PID
or change the port in your nginx config. Your error often happens when the configured port is already in use.
Upvotes: 2