404 errors uploading files

Permalink
I'm on a dedicated server with InMotion and I have a bunch of C5 sites running on there. Everything was fine for a long time, but yesterday a client complained they were getting 404 errors uploading files (see attached).

Doing a little digging, I found that this was an issue with all of the sites on this box. Upload shows the 404 error in the upload dialog for anything larger than about 200k. Smaller files are working fine. post_max and upload_max are both set to 128M.

Attempting upload for any file larger than ~200k:
- Single file upload hangs on the throbber activity indicator thingie.
- Multiple file uploader shows upload progress and then the 404 error.

BUT... I can import the same image using the "Add Image Remotely" tab in the "Upload Multiple" dialog. For example,http://images4.fanpop.com/image/photos/16100000/-cats-16140154-1920... will upload remotely just fine, but downloading the image and then uploading from my desktop computer, it chokes.

Environment info for a site is attached.

I have sites running C5 versions 5.4.x - 5.6.2.1. The issues are the same for every site.

I realize my php version (5.2 something) is below posted requirements. It's being upgraded to 5.3.25 by my host now. But I don't believe this is the issue, since I haven't had any problems on this box (which is about 2 years old) until now. I don't anticipate inmotion is going to be of much help, so wanted to put this out to the community before I even contact them about it.

Thanks in advance.

2 Attachments

BigBobbyD
 
Job replied on at Permalink Reply
Job
Within C5 go to: /index.php/dashboard/system/environment/file_storage_locations/
(or search file storage locations) and ensure the path is correct and exists.

Check that the daemon has permissions on the files folder (aswell as uploads and config)
BigBobbyD replied on at Permalink Reply
BigBobbyD
Thanks... The upload directory exists, and the permission are set to 755.
jasteele12 replied on at Permalink Reply
jasteele12
If smaller files can upload it's not the directory path or permissions settings.

I'd probably start by contacting inMotion and ask them if they upgraded PHP, or changed settings.

You could try increasing your php.ini max_execution_time which is currently set for only 30 seconds:

; -1 = unlimited
; 60 = probable deployment max (60 seconds)
; 30 = reasonable production (on most servers)
max_execution_time=-1


You might try using a stopwatch and time how long it takes to fail...
jshannon replied on at Permalink Best Answer Reply
jshannon
FYI, Everybody. It turned out to be a problem with Mod_security.

Even though the the post_max_size and upload_size in PHP may be more than enough, mod_security enforces its own sizes. Specifically in this instance it actually stores all requests larger than a certain limit (about 128k by default) to its own temp folder. In this case, the temp folder didn't exist.
BigBobbyD replied on at Permalink Reply
BigBobbyD
Turns out the issue was a missing /tmp/mod_security directory.

Snaps to InMotion for elevating the issue to bona fide support ticket, although it was solved before they actually helped.

The issue was identified and fixed by jshannon, who responded to my posting in the Jobs forum for help, so bigger snaps to him.