After upgrading a Debian server to use mod_fcgid to run PHP instead of mod_php, I started seeing Internal Server Errors on some pages. Apache Error log had the following:
[error] Premature end of script headers: index.php
I haven’t seen messages this useless since my days of coding in Perl! I realized it must be an issue of timeout, since the message appeared after some loading time. Using the following resource, I changed fcgid.conf in /etc/apache2/mods_available directory, adding:
BusyTimeout 256
ProcessLifeTime 256
IPCConnectTimeout 60
IPCCommTimeout 256
This let the script run longer, allowing it to finish, and release the output to the browser. If it doesn’t work for you, increase the values until it does.
Leave a Reply