I'm putting this in primarily because there are many bug reports filed about having problems with upload and file field not being able to upload larger files. I've been battling this for a little while, and it took me a long time to find what the issue is and to fix it, so I thought I'd put in an issue about the solution.
I'm using mod_fcgid to run PHP on my servers, and I recently had a lot of trouble with upload module where some files would not upload succesfully, and some would The failures were fairly silent, didn't log any errors, and the end result would always either be a report that the file could not be uploaded (and no error message in the logs) or the file WOULD upload, but would be corrupted.
Turns out that some of the recent versions of mod_fcgid have a bug that breaks file uploads. Versions after 2.3.2 and before 2.3.5 will only reliably upload files that are smaller than FcgidMaxRequestInMem is configured. This is a bug, and it was fixed in 2.3.5. A possible workaround is to put in a value for FcgidMaxRequestInMem that is larger than your maximum uploads, but rebuilding mod_fcgid out of the current svn source made the problem go away altogether. If you're running mod_fcgid and are having upload problems, you should check what version of mod_fcgid you're using.
Comments
Comment #1
Carlos Miranda Levy commentedI have posted detailed instructions for downgrading to libapache2-mod-fcgid to 1:2.2-1 on my blog at http://www.socinfo.com/ubuntu/php/fcgid/bug-fix-corrupt-files-upload
Short Summary here:
That's it. You can reload Apache and restart Apache:
You can see the actual version of libapache2-mod-fcgid installed by typing:
And you can do an actual upgrade to test that this version is kept throughout updates. You will see a notice when doing the upgrade that this package will be ignored.
Finally, don't forget to keep an eye on the Ubuntu 10.04 package repositories, for eventually they will upgrade to include a newer version of libapache2-mod-fcgid which does not present this problem. Version 2.3.5 reportedly fixes the issue (see here). At that moment you can "unhold" the package for it to be included in upgrade operations.
Detailed info and additional links at:
http://www.socinfo.com/ubuntu/php/fcgid/bug-fix-corrupt-files-upload
Comment #2
kars-t commentedThanks for the information. ThisThanks for the information.
Maybe this could be added to documentation somewhere or you should provide a blogpost about it. But this issue seems fixed than.