500 internal server error while uploading files bigger then 100kb – mod_fcgid problem
When the PHP handler is fast cgi, even if the post_max_size and upload_max_filesize are set to 20mb, when we upload a file say 20 MB via any application in our website, the site shows a 500 error. The Apache error log will show a similar error:
[Fri Jul 08 12:36:14 2011] [warn] [client 220.127.116.11] mod_fcgid: HTTP request length 132356 (so far) exceeds MaxRequestLen (131072), referer: http://www.montenasoft.com/…/upload.html
MaxRequestLen from mod_fcgid (and we are running fast cgi for PHP) is limiting request length to only 130kb – If the size of the request body exceeds this amount, the request will fail with 500 Server Error.
Fix is easy you just need to add in your httpd.conf next lines.
# 20MB should be enough
We can do this from WHM.
* Login to WHM and go to “Apache Configuration”, and then select “Include Editor”.
* Then in “Pre VirtualHost Include” section select “All versions” add custom MaxRequestLen configuration, and hit update.
* And don’t forget to restart apache on the end.
Now we can upload 20MB files without 500 error.