Home > php教程 > php手册 > body text

ubuntu12.04安装php5

WBOY
Release: 2016-06-06 19:54:19
Original
874 people have browsed it

在ubuntu12.04中安装配置LNMP时 出现在php5-fpm的错误 2013/04/26 04:01:05 [crit] 6119#0: *4 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 159.53.110.141, server: 216.238.8

在ubuntu12.04中安装配置LNMP时 出现在php5-fpm的错误

2013/04/26 04:01:05 [crit] 6119#0: *4 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 159.53.110.141, server: 216.238.88.42, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "216.238.88.42:9090


nginx中是这样配置的

       location ~ \.php$ {
                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;
                include fastcgi_params;
        }

我个人的配置是想用sock的方法 毕竟sock方式对于高并发来说 还是比使用cgi方式好的

问题其实出现在 fastcgi_pass得配置上面。在ubuntu 12.10安装了php5-fpm之后。我们可以去

/etc/php5/fpm/pool.d/www.conf

里面找到这样一段代码:

listen = 127.0.0.1:9000 

在这上面代码的下面添加一行:

listen = /var/run/php5-fpm.sock

保存后启动php5-fpm

/etc/init.d/php5-fpm restart

这时就可以正常访问了




Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!