Premature end of script headers: index.php, mod_fcgid: read data timeout in 61 seconds

喜夏-厌秋 提交于 2019-11-27 15:01:01

If you can access Linux server please edit /etc/httpd/conf.d/fcgid.conf file with vim.
Change FcgidIOTimeout 45 to FcgidIOTimeout 600.
Restart Apache.
Then Fast CGI timeout will be solved.

I had this problem on a MediaTemple Grid instance with a Drupal7 install; turns out it was being caused by FastCGI; switching to normal / stable CGI seems to have fixed the issue.

If you're using virtual hosts (in my case i've ispconfig) you need to do changes in virtual host config files. These files are under /etc/httpd/conf/sites-available for each virtual host. Just edit your desired config file, locate IPCCommTimeout and set current value to a higher number. You may need to do this change for both variables in same config file in case you have regular and SSL sites.

Essentially your scripts are running too long for the server configuration. mod_fcgid is waiting for php to respond, and its set to give up after 61 seconds. Since this shared hosting, you may not be allowed to change it.

This is not something that should be run via browser/web server anyway. Write it as a console script.

If any problem involve with mod_fcgid like below: _mod_fcgid: read data timeout in XX seconds _mod_fcgid: can't apply process slot for

Please fix these issues with priority:

_Increasing the memory limit of php (default 128M, up to 256, 384, ... then restart apache anh check it again)
_Increasing the time out of FCGI, but not need if above is ok

read data timeout in 61 seconds

They timed out. It's likely your execution time is set to 60 seconds. So at 61 seconds, the process was killed and therefore had a premature end.

You can adjust your timeout (not recommended) or run the script through another source (recommended).

mod_cfgid introduces other time limits besides PHP's max_execution_time while executing php scripts. Whichever comes first "wins".

As far as I can see, there are numerous time limit configuration items that mod_cfgid considers, and I'm not the expert to tell which one does which, but at least in our case adding the following line

IPCCommTimeout  9999

in the fcgid.conf solved our unexpected timeout problems.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!