nginx ubuntu 下正常解析php

nginx ubuntu 下正常解析php

2014-02-13 05:23  作者: linuxpark  来源: 本站  浏览: 5 views  我要评论  字号: 大 中 小

摘要: 背景: 安装nginx,按照php5-fpm(出了个warning) 访问php,出现gateway错误 nginx log如下: 2014/02/12 16:48:50 [crit] 13365#0: *8 connect() to unix:/v...

背景:

安装nginx,按照php5-fpm(出了个warning)

访问php,出现gateway错误

nginx log如下:

2014/02/12 16:48:50 [crit] 13365#0: *8 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost"

2014/02/12 16:48:50 [crit] 13365#0: *8 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost"

解决办法:

问题其实出现在 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


重启fpm



你可能感兴趣的:(nginx ubuntu 下正常解析php)