Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: 500 internal server error while uploading files bigger than 100kb  (Read 2805 times)

0 Members and 1 Guest are viewing this topic.

jominj

  • Guest
500 internal server error while uploading files bigger than 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 2013] [warn] [client 91.182.145.210] mod_fcgid: HTTP request length 132356 (so far) exceeds MaxRequestLen (131072), referer: http://www.domain.com/.../upload.html

MaxRequestLen from mod_fcgid 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.
Code: [Select]
# 20MB should be enough
MaxRequestLen 20000000
We can do this from WHM also.

* 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.