背景:
安装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,搞定
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。