2

I am getting 2 errors as mentioned below.

[Fri Jan 09 04:10:23 2015] [warn] [client 188.165.15.22] mod_fcgid: read data timeout in 31 seconds [Fri Jan 09 04:10:23 2015] [error] [client 188.165.15.22] Premature end of script headers: index.php

I checked this Premature end of script headers: index.php, mod_fcgid: read data timeout in 61 seconds also. But I do not have any file like /etc/httpd/conf.d/fcgid.conf to edit.

Does anybody have any idea?

I don't think that there might be any issue with php script as it as been working fine from past 1 year. Now all of sudden it has stopped working.

My Apache version is 2.2.22 and PHP Version 5.3.10-1ubuntu3.13

Content of fcgid.conf:

<IfModule mod_fcgid.c> 
   AddHandler fcgid-script .fcgi 
   FcgidConnectTimeout 20 
   FcgidIOTimeout 2000 
</IfModule>
Community
  • 1
  • 1
vinay saini
  • 355
  • 2
  • 9
  • 17
  • Which version of Apache are you on and on which platform do you run it? – Hans Z. Jan 09 '15 at 09:26
  • @HansZ. I have edited my question with apache and platform information. – vinay saini Jan 09 '15 at 10:24
  • Possible duplicate of [Premature end of script headers: index.php, mod\_fcgid: read data timeout in 61 seconds](http://stackoverflow.com/questions/14488567/premature-end-of-script-headers-index-php-mod-fcgid-read-data-timeout-in-61-s) – kenorb Apr 06 '16 at 21:03

3 Answers3

3

You can increase the timeout as indicated in the other post:

FcgidIOTimeout 600

But since you are on Ubuntu, you'll find the relevant configuration file here:

/etc/apache2/mods-available/fcgid.conf
Hans Z.
  • 50,496
  • 12
  • 102
  • 115
  • Yeah I found the file and I edited it by adding "FcgidIOTimeout 600" but still it is not working. I tried it to give "FcgidIOTimeout 2000" also but not working. I have restarted the apache server also. – vinay saini Jan 09 '15 at 10:36
  • The content of fcgid.conf now is AddHandler fcgid-script .fcgi FcgidConnectTimeout 20 FcgidIOTimeout 2000 – vinay saini Jan 09 '15 at 10:42
  • if the error is still `read data timeout in 31 seconds ` then it doesn't look like `FcgidIOTimeout 2000` was picked up; can you grep all Apache config files and see if you override it somewhere else: `grep -r "FcgidIOTimeout" /etc/apache2/` – Hans Z. Jan 09 '15 at 10:56
  • I did grep but it did not give me any result. – vinay saini Jan 09 '15 at 11:15
  • Not even `mod_fcgid.conf`, the file that you just modified?? In that case you have a typo in either one of those. – Hans Z. Jan 09 '15 at 11:22
  • These 2 results I am getting /etc/apache2/mods-available/fcgid.conf: FcgidIOTimeout 600 /etc/apache2/mods-enabled/fcgid.conf: FcgidIOTimeout 600 – vinay saini Jan 09 '15 at 11:31
  • Try restart not reload and if that does not work I'm out of options. – Hans Z. Jan 09 '15 at 11:38
  • 2
    check you individual site conf too eg: /etc/apache2/sites-available/domain.com.au.conf – Hayden Thring Jun 24 '15 at 11:10
2

For me it was 41 seconds and it was coming from the httpd.conf file of the site

# /etc/apache2/sites-available/website.com.conf
<VirtualHost ipv4:80 [ipv6]:80>
  IPCCommTimeout 600 #increased from 41
</VirtualHost>
Whip
  • 1,891
  • 22
  • 43
1

If you're using FcgidCmdOptions, see answer to this question - mod_fcgid read timeout from pipe, end of script output before headers, multiple versions of PHP . In short - global options are ignored for the program specified in FcgidCmdOptions, so all timeouts have to be configured directly in this instruction.

Community
  • 1
  • 1
astax
  • 1,769
  • 1
  • 14
  • 23