report 502 errors without any effect.② Refresh from the server: If you click the link of the web page you want to browse again, you will find that the 502 bad getway page is still displayed and can be viewed again now!Why? When you click the webpage link you want to browse, the data will be re-downloaded from the server.The solution is to refresh the server: pre
There was a strange problem today when the form was submitted directly 502 bad gateway! Begin to suspect is a program problem, then check the program is normal, found that post field number is greater than 1000 when 502 bad Gateway
The principle is to use curl to obtain the HTTP header and execute the command to restart PHP-FPM when the 502 status code is found.
CopyCodeThe Code is as follows :#! /Usr/bin/PHP
$ Cmd = '/usr/local/PHP/sbin/PHP-FPM restart ';
For ($ I = 0; $ I $ Res = shell_exec ($ Exec );
If (stripos ($ res, '2014, 502 Bad gateway
The principle is to use Curl to obtain HTTP headers, found 502 status code to perform the restart PHP-FPM command.
Copy Code code as follows:
#!/usr/bin/php
$cmd = '/usr/local/php/sbin/php-fpm restart ';
for ($i = 0; $i $res = Shell_exec ($exec);
if (Stripos ($res, ' 502 Bad Gateway ')!== false) {
S
The 502 error is the one that all nginx running PHP don't want to see.
Nginx 502 has many reasons, but most of the reasons can be attributed to the lack of resources, that is, the back-end php-fpm processing problems, nginx the correct client request to the backend PHP-FPM p
Nginx 502 has many reasons, but most of the reasons can be attributed to the lack of resources, that is, the back-end php-fpm processing problems, nginx the correct client request to the backend PHP-FPM process, However, because of the PHP-FPM process problems caused by the failure to parse the PHP code correctly, finally returned to the client
Cause1. PHP FastCGI Process count is insufficientWhen the number of concurrent accesses to the website is huge, the number of php fastcgi processes is not guaranteed, because cgi works in a single thread and multiple processes, that is to say, cgi needs to process a page before continuing the next page. If the number of processes is not enough, when the access is huge, cgi processes the previous requests in line, and the subsequent requests will only be abandoned. In this case,
You can try to clear the browser cache access to your FTP to see if you can log in
Successfully resolved 502 Bad Gateway error
Log on Today, show 502 bad Gateway,nginx the most annoyi
are as followsMv/usr/lib64/libsqlite3.so.0.8.6/usr/lib64/libsqlite3.so.0.8.6.bak
Modify the landing wordpress, open the update page and plugin page, really do not appear 502 Bad Gateway error.
Solve this problem.
But now I'm surprised that the person who thinks of the second method is a man of God. How can
introduce
A server (not necessarily a WEB server) is being used as a gateway or proxy to fulfill a request from a customer (such as your browser or our Checkupdown robot) to access the desired URL. To complete the request, this server accesses an upstream server but receives an invalid response.
This usually does not mean that the upstream server is closed (no response to the gateway/proxy), but that the up
LNMP common 502 Bad Gateway Problems
When we configure LNMP, we always encounter 502 problems. Whether it is in the browser or using the curl command, it is easy to see "502 Bad Gateway
does not request the server again.
Most users are often so refreshed, encountered 502 of the error will have no effect.
② from the server refresh: If you re-click on the page you want to browse the link, you will find that the page is still showing 502 bad Getway now can be normal browsing!
Do you understand? When you click on the page you want to browse the
A large number of queries often appear 502 bad Gateway
Millions of data were checked directly Nginx 502 bad gateway. Another server is good. I cannot log on to the server to view the co
LNMP upgrade php5.4.28 or later version error 502 bad Gateway
Encounter a very strange problem, with LNMP./upgrade_php.sh upgrade php5.4.27 normal.
But upgrade to php5.4.28 error, Access p.php hint: Nginx 502 bad
PHP program appears 502 bad gateway how to break?
Reply content:
PHP program appears 502 bad gateway how to break?
Confirm that the PHP-FPM process is healthy, and then start with the run environment and adjust the timeout
1th: Resource problems caused by request_terminate_timeout if the value of Request_terminate_timeout is set to 0 or too long, it may cause file_get_contents resource problems. If the remote resource requested by file_get_contents is too slow, file_get_contents will remain stuck there and will not time out.We know php.ini inside.Max_execution_timeYou can set the maximum execution time for PHP scripts, but in php-cgi (PHP-FPM), this parameter is not effective. The real ability to control the maxim
Millions of data were checked directly Nginx 502 bad gateway. Another server is good. I cannot log on to the server to view the configuration. Ask you to get nginx+php comrades. What are the settings of your server? I sent it to the hardware department.
Reply to discus
parameter will not work. The real ability to control the maximum execution time for PHP scripts is the following parameters in the php-fpm.conf configuration file:Attention! The format of the new PHP-FPM in the configuration file is:request_terminate_timeout=0sThe default value is 0 seconds, which means that the PHP script will continue to execute. This way, when all the php-cgi processes are stuck in the file_get_contents () function, the nginx+php
/wwwroot/jifen.51.com/www/index.php'(Request:"Get/center/index") Execution timed out(31.055392sec), terminating[ in-dec- . ,: -: One] WARNING: [Pool www] Child9978, script'/opt/wwwroot/jifen.51.com/www/index.php'(Request:"Get/center/index") Execution timed out(30.037908SEC), terminatingOpen the php-fpm.conf configuration file, set the Request_terminate_timeout = 30 set of a single script execution more than 30s will be terminated.And in the php.ini config file Max_execution_time = 60, set a sin
Site Access Tips 502 Bad gateway how to solve. According to the analysis is generally the PHP thread open file handle restricted caused.share in Linux environment site hints 502 Bad Gateway solution
1, raise the file handle
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.