Articles in this section

Website or webmail shows 500 internal server error on Plesk: mod_fcgid: read data timeout

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • A website or webmail page is not loading and 500 internal server error or 504 Gateway Time-out error is shown after ~30-60 seconds.
  • The following errors can be found in Domains > example.com > Logs:

    CONFIG_TEXT: [warn] mod_fcgid: read data timeout in 45 seconds
    [error] Premature end of script headers
    [core:error] End of script output before headers 

  • The following error can be found in /var/log/apache2/error.log:

    CONFIG_TEXT: [warn] mod_fcgid: process XXX graceful kill fail, sending SIGKILL

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 parameter value or optimize FastCGI application.

Domain-wide solution (click to expand)

Domain-wide solution. FcgidIOTimeout parameter for a domain is set to the same value as max_execution_time PHP parameter.

  1. Log into Plesk UI.
  2. Increase max_execution_time (e.g. to 300) in Domains > example.com > PHP settings
  3. Add the following to Domains > example.com > Apache & Nginx settings > Additional directives for HTTP and Additional directives for HTTPS:

    CONFIG_TEXT: <IfModule mod_fcgid.c>
    FcgidIOTimeout 300
    </IfModule>

  4. If it does not help, increase the parameter to higher value. 

Optionally, switch the domain to FPM handler at Domains > example.com > PHP Settings.

Server-wide solution (click to expand)

Server-wide solution:

  1. Connect to the server using SSH.
  2. Open the /etc/apache2/mods-enabled/fcgid.conffile (on Debian/Ubuntu) or the /etc/httpd/conf.d/fcgid.conf file (on RedHat/CentOS/CloudLinux), edit it with text editor and increase "FcgidIdleTimeout" and "FcgidProcessLifeTime" parameters to "300" or more:

    FcgidIdleTimeout 300
    FcgidProcessLifeTime 300

  3. Reload Apache service configuration:

    On RedHat/CentOS/CloudLinux systems:

    # service httpd reload

    On Debian/Ubuntu systems:

    # service apache2 reload

  4. If it does not help, increase the value of both parameters to higher values and reload Apache service configuration.
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.