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

前端 未结 8 1586
轻奢々
轻奢々 2020-12-03 10:45

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 wo

相关标签:
8条回答
  • 2020-12-03 11:00

    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).

    0 讨论(0)
  • 2020-12-03 11:03

    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.

    0 讨论(0)
  • 2020-12-03 11:04

    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.

    0 讨论(0)
  • 2020-12-03 11:04

    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.

    0 讨论(0)
  • 2020-12-03 11:18

    Increase the max_execution_time value, i.e.:

    <?php
    ini_set('max_execution_time', 300); # 5 minutes
    ...
    
    0 讨论(0)
  • 2020-12-03 11:21

    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.

    0 讨论(0)
提交回复
热议问题