PHP 经常提示 504 Gateway Time-out


问题

win7 安装的 nginx1.6.2 官网版 + wamp的PHP库,然后程序里面有PHP 使用curl去采集一个远程程序,但是总是会出现 504 Gateway Time-out 提示!使用的是wamp里面的PHP,无php-fpm,如何修改 max_children 参数?

启动代码


 @echo off
REM Windows 下无效
REM set PHP_FCGI_CHILDREN=5

REM 每个进程处理的最大请求数,或设置为 Windows 环境变量
set PHP_FCGI_MAX_REQUESTS=1000

echo Starting PHP FastCGI...
RunHiddenConsole D:/wamp/bin/php/php5.5.12/php-cgi.exe -b 127.0.0.1:9000 -c D:/wamp/bin/apache/apache2.4.9/bin/php.ini

echo Starting nginx...
RunHiddenConsole D:/nginx/nginx.exe -p D:/nginx

php-fpm 504 php nginx curl

MARIKA 10 years, 2 months ago

修改Nginx配置:
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;

清廉正直文文丸 answered 10 years, 2 months ago

设置php脚本

set_time_limit(0);
ignore_user_abort();

某个安静的路人 answered 10 years, 2 months ago

set_time_limit(0);
504是web服务报的,一般是程序执行超时。

打酱油的啊 answered 10 years, 2 months ago

Your Answer