How to fix internal server error 500 in cpanel web server because of fcgid:warn in /usr/local/apache/logs/error_log as mod_fcgid: read data timeout in 40 seconds
Sometime you may face internal server error 500. When you check the apache server error log you can see fcgid warning as mod_fcgid: read data timeout in 40 seconds. By default cPanel software is set to mod_fcgid read data timeout in 40 seconds. This is not enough for some of the heavy scripts run by you website or your clients.
If you are running a web hosting company or having website with heavy scripts, then you must change the value of mod_fcgid read timeout value to 100 or above. I prefer to use the value 400.
You can check Apache server log by using the following command via terminal client in mac or putty.exe in windows
tail -n 200 /usr/local/apache/logs/error_log
The above command will list the last 200 lines of error codes. You need to be looking for the internal server or 500 error.
if you see anything like below, it means the internal server error occurred due to mod_fcgid: read data timeout in 40 seconds.
[Mon Mar 13 16:43:13.293822 2017] [fcgid:warn] [pid 634125] [client 123.00.00.00:50441] mod_fcgid: read data timeout in 40 seconds, referer: http://www.demo.com/testing/auto_api_to_shopping
Now to fix this you need to increase mod_fcgid read data timeout value from 40 to higher value say 400.
How to increase mod_fcgid read data timeout value in cpanel/WHM CentOS/CloudLinux web server ?Login to WHM > Apache Configuration > Include Editor > Post VirtualHost Include > All
Add the following code into it.
<IfModule mod_fcgid.c>Restart Apache
This will change the FastCGI timeout to 400 seconds.
You are done !