mod_fcgi timeout error for PHP

The solution for Internal Server Error (500) for PHP running on apache like webmin/drupal, etc.

If you see an error message like mod_fcgid timeout ..., you may try this way:

Edit the apache configuration for modulde fcgi.  e.g. in debian /etc/apache2/module-available/fcgid.conf

add the following two lines

  IPCConnectTimeout 300
  IPCCommTimeout 300

 

with <IfModule> ... </IfModule>

For virtualmin users, there is a default 31 seconds in virtual host configuration file.  You have to change it in virtualmin menu:

Server Configuration > Website Options

It shows 30 seconds inside (no 31), just change it to 300 for fune.

 

The default is obviously not enough especially running cron in Drupal or long query.