目前我的Centos 6.8服务器上有502 Bad Gateway Error.
2017/01/30 23:57:31 [crit] 26911#0: *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream,client: 192.168.0.15,server: 192.168.0.$
我检查了目录是否存在但是没有.我能找到的最接近文件夹的是/ var / run / php-fpm,它只包含php-fpm.pid.
以下是解决此问题的步骤:
>检查php-fpm是否正在运行:
sudo service php-fpm status sudo service php7-php-fpm status # use this if you are using remi PHP 7
>在php-fpm的www.conf配置文件中检查listen指令:
grep -Ri listen /etc/php/7.0/fpm/pool.d/www.conf grep -Ri listen /etc/opt/remi/php70/php-fpm.d # for remi
>确保您的nginx fastcgi_pass指令与您的listen指令匹配.