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

46,727

Solution 1

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.

Solution 2

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.

Solution 3

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.

Share:
46,727
Bilal Gultekin
Author by

Bilal Gultekin

Updated on July 09, 2022

Comments

  • Bilal Gultekin
    Bilal Gultekin almost 2 years

    I wrote a simple crawling script (in php) at localhost (with 4 variations). All of them worked fine at localhost. But when I made move them to shared hosting, two of them worked others gave internal server error. I looked at error_log and I saw these line:

    [Wed Jan 23 22:01:02 2013] [warn] [client ***] mod_fcgid: read data timeout in 61 seconds
    [Wed Jan 23 22:01:02 2013] [error] [client ***] Premature end of script headers: index.php
    

    I searched but I couldn't find any useful result. What is related to these errors? Any ideas?

  • Kamel Labiad
    Kamel Labiad over 9 years
    my site on Mediatemple too and that also fixed it
  • enrey
    enrey over 9 years
    This is the answer to life, universe, weird timeouts! It should be the accepted one.
  • enrey
    enrey over 9 years
    I'd downvote, the answer isn't useful at all and it doesn't say what timeout timeouted. My execution time is at 150 seconds and it still times out at 31.
  • Jason McCreary
    Jason McCreary over 9 years
    The question focused on what caused the error not how to fix. To your question, and downvote, considering the message was thrown by mod_fcgid you should adjust the FastCGI timeout. I'd start there as trante's answer explains more about how.
  • Gogol
    Gogol almost 8 years
    @enrey hilaariousss :D
  • Anyone_ph
    Anyone_ph over 7 years
    Would become crazy if this answer was not on stack ! Thanks
  • roaima
    roaima over 7 years
    600 seconds is 10 minutes. If you've a script that's taking this long it'll probably timeout elsewhere too (particularly the user themselves).
  • Parapluie
    Parapluie almost 7 years
    Crazy question for you: what if the config defined both FcgidMaxRequestLen and FcgidBusyTimeout, but not * FcgidIOTimeout*? Is there a default value if it is not defined?