[ArticleAuthor: Zhang banquet this article version: V1.0 last modified: 2008.07.30 reprint please indicate the original article link: http://blog.s135.com/read.php/361/]
Yesterday, a friend asked me how to solve the "502 Bad Gateway" error when he changed the Web server to nginx 0.6.31 + PhP 4.4.7 (FastCGI.
I will follow the two steps below to solve the problem, and finally increase the timeout time of FastCGI to 2nd in step 1. Solve the problem:
PS: I envy Thunder's web server, with 16 GB of memory.
1. Check whether the current PHP FastCGI process count is sufficient:
Netstat-anpo | grep "PHP-cgi" | WC-l
If the number of FastCGI processes actually used is close to the preset number of FastCGI processes, it indicates that the number of FastCGI processes is insufficient and needs to be increased.
2. Some PHPProgramThe execution time of nginx exceeds the waiting time of nginx. You can add the timeout time of FastCGI in the nginx. conf configuration file, for example:
......
HTTP
{
......
Fastcgi_connect_timeout 300;
Fastcgi_send_timeout 300;
Fastcgi_read_timeout 300;
......
}
......