ubuntu下使用lnmp環境安裝laravel報錯

來源:互聯網
上載者:User
我使用的是ubuntu麒麟版,安裝配置完lnmp環境後,使用composer安裝laravel4.2,居然報502錯誤,查看nginx的log和fpm的log發現如下錯誤:

nginx的.log:

2014/06/01 22:23:46 [error] 7572#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: www.tb.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.tb.com"

php5-fpm的log:

[02-Jun-2014 21:59:38] WARNING: [pool www] child 12547 exited on signal 11 (SIGSEGV - core dumped) after 13121.206611 seconds from start[02-Jun-2014 21:59:38] NOTICE: [pool www] child 13820 started

nginx的設定檔如下:

server {        listen 80;        #listen [::]:80 default_server ipv6only=on;        root /www/taobao/public;        index index.html index.htm index.php;        server_name www.tb.com;        location / {                try_files $uri $uri/ /index.php?$query_string;        }        location ~ \.php$ {                try_files $uri $uri/ =404;        #       fastcgi_split_path_info ^(.+\.php)(/.+)$;        #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini        #        #       # With php5-cgi alone:        #       fastcgi_pass 127.0.0.1:9000;        #       # With php5-fpm:                fastcgi_pass unix:/var/run/php5-fpm.sock;                fastcgi_index index.php;                fastcgi_param SCRIPT_FILENAME /var/www/project/public$fastcgi_script_name;                include fastcgi_params;        }}

還有一點,執行單個php檔案是沒有問題的,phpinfo裡也可以看到該添加的擴充都已經安裝了

回複內容:

我使用的是ubuntu麒麟版,安裝配置完lnmp環境後,使用composer安裝laravel4.2,居然報502錯誤,查看nginx的log和fpm的log發現如下錯誤:

nginx的.log:

2014/06/01 22:23:46 [error] 7572#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: www.tb.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.tb.com"

php5-fpm的log:

[02-Jun-2014 21:59:38] WARNING: [pool www] child 12547 exited on signal 11 (SIGSEGV - core dumped) after 13121.206611 seconds from start[02-Jun-2014 21:59:38] NOTICE: [pool www] child 13820 started

nginx的設定檔如下:

server {        listen 80;        #listen [::]:80 default_server ipv6only=on;        root /www/taobao/public;        index index.html index.htm index.php;        server_name www.tb.com;        location / {                try_files $uri $uri/ /index.php?$query_string;        }        location ~ \.php$ {                try_files $uri $uri/ =404;        #       fastcgi_split_path_info ^(.+\.php)(/.+)$;        #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini        #        #       # With php5-cgi alone:        #       fastcgi_pass 127.0.0.1:9000;        #       # With php5-fpm:                fastcgi_pass unix:/var/run/php5-fpm.sock;                fastcgi_index index.php;                fastcgi_param SCRIPT_FILENAME /var/www/project/public$fastcgi_script_name;                include fastcgi_params;        }}

還有一點,執行單個php檔案是沒有問題的,phpinfo裡也可以看到該添加的擴充都已經安裝了

不要用一鍵安裝包。
php安裝5.4以上版本
fastcgi使用ip:port。不要使用unix:sock

script_name 使用$document_root配置,例如:

fastcgi_params SCRIPT_NAME $document_root$fastcgi_script_name;
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.