Home >php教程 >php手册 >解决php导致nginx报502 bad gateway错误问题

解决php导致nginx报502 bad gateway错误问题

WBOY
WBOYOriginal
2016-05-26 08:20:391797browse

502 bad gateway这个问题很多朋友一看就以为是nginx或apache的问题,其实不然了,除了它们两会出现这个问题之外还有像php模块也会导致此问题的出现了,下面一起来看看吧.

502 bad gateway不一定全是nginx,apache之类引起的,也有可能是由其他模块引起的,例如:php

1,查看php-fpm和nginx的log

# vim /var/log/nginx/error.log 
recv() failed (104: Connection reset by peer) while reading response header from upstream  
# vim /var/log/php-fpm/error.log 
WARNING: [pool www] child 29522 exited on signal 11 (SIGSEGV - core dumped) after 2165.472759 seconds from start

2,由php的eaccelerator导致502 bad gateway错误

我根据上面的二个错误,在网上找方法大部分都说是由nginx或者apache引起的,最近并没有动nginx的配置,不可能好好的就不行了,当看到有说php扩展apc,有可能会引起502 bad gateway时,因为eaccelerator根apc差不多,猜想会不会是eaccelerator引起502呢?

# mv /etc/php.d/eaccelerator.ini{,bak}   
# /etc/init.d/php-fpm restart

重启后问题解决,开始的时候,我以为是cache目录和log目录的权限导致502的,就算改了所属用户,并且在加上777权限,也还是502错误.


教程链接:

随意转载~但请保留教程地址★

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn