Jack Barber / Website Design

Why Are File Uploads Causing a '500 Error'?

A couple of times recently, I've been having trouble with file uploads to the server causing 500 Internal Server Errors.  The first time it happened I solved the problem but forgot to keep a record of what it was that I'd done to fix it.  So, when it happened again (tonight) I thought I'd make a note of the fix just in case it helps anyone else (or I need to remember it again in the future!)

Usually file upload errors are caused by php.ini settings, but it would be unusual for that to result in an Internal Server Error.  The culprit is the fcgid.conf file which can be located here:

/etc/httpd/conf.d/fcgid.conf

All you have to do is add this line:

FcgidMaxRequestLen 1073741824

before.  It will increase the max file upload size allowed by Apached to 1gb (change the number if you want a different amount), from the default limit (128kb).  Don't forget to restart Apache after making the change.