ubuntu下使用lnmp环境安装laravel报错

WBOY
發布: 2016-06-06 20:45:21
原創
1217 人瀏覽過

我使用的是ubuntu麒麟版,安装配置完lnmp环境后,使用composer安装laravel4.2,居然报502错误,查看nginx的log和fpm的log发现如下错误:

nginx的.log:

<code>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"
</code>
登入後複製
登入後複製

php5-fpm的log:

<code>[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
</code>
登入後複製
登入後複製

nginx的配置文件如下:

<code>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;
        }
}
</code>
登入後複製
登入後複製

还有一点,执行单个php文件是没有问题的,phpinfo里也可以看到该添加的扩展都已经安装了

回复内容:

我使用的是ubuntu麒麟版,安装配置完lnmp环境后,使用composer安装laravel4.2,居然报502错误,查看nginx的log和fpm的log发现如下错误:

nginx的.log:

<code>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"
</code>
登入後複製
登入後複製

php5-fpm的log:

<code>[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
</code>
登入後複製
登入後複製

nginx的配置文件如下:

<code>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;
        }
}
</code>
登入後複製
登入後複製

还有一点,执行单个php文件是没有问题的,phpinfo里也可以看到该添加的扩展都已经安装了

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

script_name 使用$document_root配置,例如:

<code>fastcgi_params SCRIPT_NAME $document_root$fastcgi_script_name;
</code>
登入後複製
相關標籤:
php
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!