Fixing Mod_fcgid: Read Data Timeout

0
6416

Domain shows 500 internal server error: mod_fcgid: read data timeout

 FcgidIOTimeout or IPCCommTimeout sets the maximum period of time the module will wait while trying to read from or write to a FastCGI application. To allow applications to take a longer time to respond, increase the value of the directive in Apapche configuration file, httpd.conf , or other included config files that contain the above directives, including within the virtual hosts configuration.

Symptoms

A domain is not loading and a “500 internal server error” is being shown after 45-60 seconds.

The following error can be observed in the domain’s /logs/error_log:

[Thu Feb 12 17:07:06 2014] [warn] [client 10.10.10.10] mod_fcgid: read data timeout in 45 seconds, referer: http://www.example.com/admin/orders.php
[Thu Feb 12 17:07:06 2014] [error] [client 10.10.10.10] Premature end of script headers: PDF.php, referer: http://www.example.com/admin/orders.php

Cause

The FcgidIOTimeout value – the maximum period of time the module will wait while trying to read from or write to a FastCGI application – has been exceeded.

Resolution

Increase the FcgidIOTimeout value in fcgid.conf and restart Apache.

CentOS: /etc/httpd/conf.d/fcgid.conf

Debian: /etc/apache2/mods-enabled/fcgid.conf

To apply the vhost configuration for all domains, please follow the guide from the documentation:

  1. Copy the default template for the domain vhost into the custom templates directory:
    # cp -p /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php
    
  2. Change the custom file accordingly:2.1 Open
    /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php

    2.2 Find the line:

    FcgidIOTimeout <?php echo $VAR->domain->physicalHosting->scriptTimeout; ?>
    

    Replace it with value you need:

    FcgidIOTimeout 150
    

    2.3 Save changes.

  3. Apply the configuration for all domains:
    # /usr/local/psa/admin/bin/httpdmng --reconfigure-all
    

Other way to solve the problem :

Running a script longer then 45 seconds causes a mod_fcgid: read data timeout in 45 seconds, this may be plesk specific.

Looking up the error its very common, the usual solution recommended is to editing /etc/httpd/conf.d/fcgid.conf

Specifically, change

FcgidIOTimeout 45

To

FcgidIOTimeout 3600

3600 seconds = 1 hour.

Then restart the server. If you don’t have root access to the server you’ll need to ask your host to do it or another way is to increase the memory limit with php at the top of the file add:

ini_set('memory_limit', '256M');

This solves the problem without needing to edit the fcgid.conf file.

 

 

Fixing Mod_fcgid: Read Data Timeout

Ref. http://kb.odin.com/ + https://daveismyname.com

Good luck .