lnmp1.0 升级php.5.4.28 后出错 Nginx 502 Bad Gateway

碰到一个很奇怪的问题,用lnmp自带的./upgrade_php.sh升级 php5.4.27正常。
但升级到php5.4.28就出错,访问p.php 提示:Nginx 502 Bad Gateway。上午的时候又试了下,升级到5.5.12访问p.php也是同样的提示:Nginx 502 Bad Gateway
升级的提示都是表示成功,php-fpm也提示启动成功。

但访问p.php页面就提示 :502,是不是php 5.4.28 以上的版本安装配置有变化?

环境:
centos 6.5  x86_64
nginx 1.60
mysql 5.5

nginx_error.log 里报错:

2014/05/27 14:04:35 [crit] 2971#0: *1 connect() to unix:/tmp/php-cgi.sock failed (13: Permission denied) while connecting to upstream

查看unix:/tmp/php-cgi.soc文件权限,果然是root:root

 解决方法为:

/usr/local/php/etc/php-fpm.conf里listen下面添加上
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
重启php-fpm

一切就变好了

posted @ 2014-05-27 18:17  siyed  Views(654)  Comments(0Edit  收藏  举报