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

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

May 26, 2016 am 08:20 AM
502 bad gateway nginx

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
Copy after login

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
Copy after login

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


教程链接:

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

Statement of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to allow external network access to tomcat server How to allow external network access to tomcat server Apr 21, 2024 am 07:22 AM

How to allow external network access to tomcat server

What are the nginx start and stop commands? What are the nginx start and stop commands? Apr 02, 2024 pm 08:45 PM

What are the nginx start and stop commands?

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

How to run thinkphp

What are the differences between tomcat and nginx What are the differences between tomcat and nginx Dec 27, 2023 pm 05:07 PM

What are the differences between tomcat and nginx

Welcome to nginx!How to solve it? Welcome to nginx!How to solve it? Apr 17, 2024 am 05:12 AM

Welcome to nginx!How to solve it?

How to register phpmyadmin How to register phpmyadmin Apr 07, 2024 pm 02:45 PM

How to register phpmyadmin

How to deploy nodejs project to server How to deploy nodejs project to server Apr 21, 2024 am 04:40 AM

How to deploy nodejs project to server

How to solve the problem of nginx when accessing the website How to solve the problem of nginx when accessing the website Apr 02, 2024 pm 08:39 PM

How to solve the problem of nginx when accessing the website

See all articles