I'm getting a 500 Error when trying to save a rather large entry. (By "rather large" I mean it includes a 4x9 Matrix, 31x4 Matrix, 5x3 Matrix, Tag, and few text fields.) The Publish screen hangs for several seconds after I click Save and then goes to the error, without saving the entry (as far as I can tell).

The error logs include the following messages:

[Mon Mar 18 16:44:18 2013] [warn] [client] mod_fcgid: read data timeout in 45 seconds, referer: http://xxx/admin.php?S=dd4fca62fd66ca80ad02acde5f1ae08bb8e947d0&D=cp&C=content_publish&M=entry_form&channel_id=3&entry_id=1512&filter=YToxOntzOjE1OiJyZXR1cm5fdG9femVuYnUiO3M6MToieSI7fQ==
[Mon Mar 18 16:44:18 2013] [error] [client] Premature end of script headers: admin.php, referer: http://xxx/admin.php?S=dd4fca62fd66ca80ad02acde5f1ae08bb8e947d0&D=cp&C=content_publish&M=entry_form&channel_id=3&entry_id=1512&filter=YToxOntzOjE1OiJyZXR1cm5fdG9femVuYnUiO3M6MToieSI7fQ==

I Googled around a bit and couldn't find anything very conclusive. Have any of yall seen this before? Is it akin to a MySQL "server has gone away" error?


That error is specific to mod_fcgid, not PHP itself. If you're using the current version of mod_fcgid then you will need to set the FcgidIOTimeout directive (ref), otherwise you'll need the old directive, IPCCommTimeout.


Thanks for the pointers, all. In this case, I ended up having to increase several timeout limits:

First, to address the original fastCGI error:


FcgidIOTimeout 90

This fixed the PHP/fastCGI error, but revealed a 500 Error coming from Nginx timing out. The fix:


keepalive_timeout  125;
proxy_read_timeout 125;
proxy_connect_timeout 125;
fastcgi_read_timeout 125;

This fixed the issue some of the time, but intermittently I would get the MySQL "MySQL server has gone away" error, which required one more tweak:


wait_timeout = 120

Then, just for funsies, I went ahead and upped my PHP memory limit, just in case:


memory_limit = 256M

For most cases solutions is incising max_execution_time as Anna told (you can also setup it in php.ini as max_execution_time 120).

But you can also try to add next lines into your .htaccess

<IfModule mod_fcgid.c>
IdleTimeout 3600
ProcessLifeTime 7200
MaxProcessCount 64
DefaultMaxClassProcessCount 8
IPCConnectTimeout 300
IPCCommTimeout 7200
BusyTimeout 300

in case if is will not helps - try to add it into you vhost, because on many hosting this option is closed in .htaccess

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.