Symptoms
- A website or webmail page is not loading and
500 internal server error
or504 Gateway Time-out
error is shown after ~30-60 seconds. -
The following errors can be found in Domains > example.com > Logs:
[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[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. FcgidIOTimeout
parameter for a domain is set to the same value as
PHP parameter.
max_execution_time
- Log into Plesk UI.
- Increase max_execution_time (e.g. to 300) in Domains > example.com > PHP settings
-
Add the following to Domains > example.com > Apache & Nginx settings > Additional directives for HTTP and Additional directives for HTTPS:
<IfModule mod_fcgid.c>
FcgidIOTimeout 300
</IfModule> -
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:
- Connect to the server using SSH.
- Open the
/etc/apache2/mods-enabled/fcgid.conf
file (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 -
Reload Apache service configuration:
On RedHat/CentOS/CloudLinux systems:
# service httpd reload
On Debian/Ubuntu systems:
# service apache2 reload
- If it does not help, increase the value of both parameters to higher values and reload Apache service configuration.