lnmp安装包出现Nginx 502 Bad Gateway错误解决方案
2012-09-19 11:30
615 查看
具体步骤:
1.修改nginx.conf
nginx安装目录:/usr/local/nginx/conf/nginx.conf,
fastcgi_pass unix:/tmp/php-cgi.sock;
改为:
fastcgi_pass 127.0.0.1:9000;
2.修改php-fpm.conf
php安装目录:,/usr/local/php/etc/php-fpm.conf
<value name="listen_address">/tmp/php-cgi.sock</value>
改为
<value name="listen_address">127.0.0.1:9000</value>
3.依次重启Nginx和php-fpm
nginx 重启:
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx -s reload
php-fpm重启:
/usr/local/php/sbin/php-fpm restart
如果还存在,可能就是fastcgi进程数不够,可适当根据自身服务器内存需要,修改cgi进程数目,在php-fpm.conf修改max_children最大数目,服务器2G内存,修改为 <value name="max_children">72</value>。
1.修改nginx.conf
nginx安装目录:/usr/local/nginx/conf/nginx.conf,
fastcgi_pass unix:/tmp/php-cgi.sock;
改为:
fastcgi_pass 127.0.0.1:9000;
2.修改php-fpm.conf
php安装目录:,/usr/local/php/etc/php-fpm.conf
<value name="listen_address">/tmp/php-cgi.sock</value>
改为
<value name="listen_address">127.0.0.1:9000</value>
3.依次重启Nginx和php-fpm
nginx 重启:
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx -s reload
php-fpm重启:
/usr/local/php/sbin/php-fpm restart
如果还存在,可能就是fastcgi进程数不够,可适当根据自身服务器内存需要,修改cgi进程数目,在php-fpm.conf修改max_children最大数目,服务器2G内存,修改为 <value name="max_children">72</value>。
相关文章推荐
- LNMP一键安装包的Nginx 502 Bad Gateway错误可能原因及解决方法
- nginx 下 thinkphp 502 bad Gateway + "LNMP一键安装包的Nginx 502 Bad Gateway错误可能原因及解决方法"
- Nginx 502 Bad Gateway错误的解决方案
- Nginx 502 Bad Gateway 错误、解决方案和监控
- LNMP时,出现502 Bad Gateway的错误提示
- NGINX转发出现502 BAD GATEWAY的错误
- nginx安装后出现502 Bad Gateway 错误解决办法
- Nginx 502 Bad Gateway错误的解决方案
- LNMP一键安装包的Nginx 502 Bad Gateway错误可能原因及解决方法
- Nginx 502 Bad Gateway 的错误的解决方案
- nginx加php-fpm出现502 bad gateway错误的5种解决方法
- Nginx 502 Bad Gateway 错误、解决方案和监控
- Nginx 502 Bad Gateway 错误的原因及解决方法
- Nginx 502 Bad Gateway 错误的原因及解决方法
- (总结)Nginx 502 Bad Gateway错误触发条件与解决方法
- nginx加php-fpm报502 bad gateway错误五种解决方法
- nginx 502 Bad Gateway 错误解决办法
- 记一次nginx部署yii2项目时502 bad gateway错误的排查
- nginx+php-fpm出现502 bad gateway错误解决方法
- Nginx 502 Bad Gateway错误的解决办法