2013-12-12 86 views
1

我想在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

檢查/etc/php5/fpm/pool.d/www.conf什麼端口使用php-fpm。可能有另一項服務在此端口上運行。 – klipach

回答

1

檢查

netstat -tap 

是否有其他應用程序在端口9000監聽如果是試圖殺死它

kill -l PID 

或更改端口在你的nginx的配置。當配置的端口已被使用時,您的錯誤經常發生。

+0

謝謝@artworkad。我通過切換到另一個端口解決了問題,因爲端口9000已被另一個進程使用。 –