如何解决“mod_fastcgi.c.2566意外结束文件(或许FastCGI进程夭折)”,呼吁.P

2019-09-20 15:34发布

在我的PHP应用程序,我恢复DB2数据库。 它工作正常,但这里是一个巨大的一个2.9GB,与完成500 - Internal Server Error

我重复使用exec()来运行从.PHP UNIX shell命令 - CP,DB2等从Firefox或Ruby脚本运行时,发生同样的错误。

我有复制的备份映像文件首先这需要几分钟。 然后,我打电话到DB2恢复的图像。 对于这个特定的数据库PHP进程完成与上述错误。 然后,我可以在错误日志文件中找到这

2012-08-02 10:25:18: (mod_fastcgi.c.2566) unexpected end-of-file (perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9090
2012-08-02 10:25:18: (mod_fastcgi.c.3352) response not received, request sent: 2758 on socket: tcp:127.0.0.1:9090 for /wrational/tools/rationalTest.php?mode=restore&database=RATIONAL&from_database=dbb&dbbackuptype=weekly, closing connection

我都设置default_socket_timeoutmax_execution_time在php.ini到5660,并确认它是由设置phpinfo()但它并不像它帮助。

任何想法,我怎样才能使这个工作?

更新

它看起来就像40分钟后死亡。 在access.log文件中相应的行看起来像

"GET /rational/tools/rationalTest.php?mode=restore&from_database=dbb&dbbackuptype=weekly HTTP/1.1" 500 369 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20100101 Firefox/11.0"

Answer 1:

看起来像在PHP-fpm.ini request_terminate_timeout选项是造成麻烦。 它被设置为30分钟。 我把它改为0,它看起来好为止。 需要做虽然更多的测试。

; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.  
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0


文章来源: How to solve “mod_fastcgi.c.2566 unexpected end-of-file (perhaps the fastcgi process died)” when calling .php that takes long time to execute?
标签: timeout php