Resolve 502 Bad Gateway errors encountered by Nginx + PHP (FastCGI) _linux
Source: Internet
Author: User
I have to follow the following two steps to resolve, and finally in the 2nd step in the FastCGI timeout time increased to 300, the problem is resolved:
PS: More envy of the Thunder Web server, 16G memory.
--------------------------------------------------------------------------------
1, see the current number of PHP fastcgi process is sufficient:
Netstat-anpo | grep "php-cgi" | Wc-l
If the actual number of "fastcgi processes" is close to the preset "fastcgi process", then the "fastcgi process count" is not sufficient and needs to be increased.
--------------------------------------------------------------------------------
2, some of the PHP program execution time than the Nginx wait time, you can appropriately increase the nginx.conf configuration file fastcgi timeout time, such as:
......
http
{
......
Fastcgi_connect_timeout 300;
Fastcgi_send_timeout 300;
Fastcgi_read_timeout 300;
......
}
......
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.