Nginx + PHP(FastCGI)的502 Bad Gateway错误

服务器 1671 0 2012-03-28

Nginx + PHP(FastCGI)的502 Bad Gateway错误
解决Nginx + PHP(FastCGI)遇到的502 Bad Gateway错误
首页确认FastCGI是否启动,启动fastcgi php:
spawn-fcgi -a 127.0.0.1 -p 9000 -C 10 -u www-data -f /usr/bin/php-cgi
--------------------------------------------------------------------------------
1、查看当前的PHP FastCGI进程数是否够用:
netstat -anpo | grep “php-cgi” | wc -l
  如果实际使用的“FastCGI进程数”接近预设的“FastCGI进程数”,那么,说明“FastCGI进程数”不够用,需要增大。
--------------------------------------------------------------------------------
2、部分PHP程序的执行时间超过了Nginx的等待时间,可以适当增加nginx.conf配置文件中FastCGI的timeout时间,例如:
……
http
{
……
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
……
}
……

上一篇:nginx配置遇到No input file specified问题的解决

下一篇:nginx下的Rewrite规则

讨论数量:0

请先登录再发表讨论。 2024-04-25

天涯网魂
3 杠 5 星
TA 的文章
TA 的随言
TA 的资源链