Uploading large files via PHP



I’m planning to start an upload portal using the e107 system, but as I remember, there’s a limit of something like 9 MB on the RAM php can use. I want to set the upload limit to 400 MB.

Is there any way around this besides using a program like Uber Uploader?


You won’t be able to successfully get away with using 400 MB of RAM on a shared server; if you need to do that, then you should look at DreamHost PS. :wink:

You can install your own PHP or use your own php.ini with a copy of DreamHost’s PHP to increase the size of the files you can upload (see the wiki or any of the dozens of related posts in these forums), but not to the degree that you use 400 MB of RAM.



Don’t touch the RAM setting! (it’s 90MB default here, as opposed to 8MB on other hosts btw)

For 400MB php file uploads you should only need to set:

post_max_size = 405M
upload_max_filesize = 400M

And maybe max_execution_time = ## ; (in seconds - your call here, test)


You mean edit php.ini?

Also, there won’t be regular 400 MB uploads, this is just the peak for a few files that may be seen once or twice a year. If that’s still not doable I could probably deal with more like 100-150 MB.


Yes, edit the settings in php.ini

Filesize restrictions are dependant upon your disk space, not RAM.


I’m still having issues uploading files above around 200 MB.

These files will be rare, but I need to have the ability to upload them on occasion. I’ve tried setting max_input_time and max_execution_time to ridiculous numbers; 5400 seconds each. Still, I’m having the issue described in the e107 thread I link to below.

Here’s the thread, thought it might be useful in figuring out what I’m doing wrong here.



It sounds to me very much as though you are running up against DreamHost’s process killer. To protect the server’s resources from abuse, and so that others’ sites on your server will not grind to a halt, the “procwatch” program will kill precesses that it feels are consuming too much resources.

This is one of the reasons that setting your memory limits very high, or changing your max_input_time or max_execution_time to large values will not necessarily work - irrespective of your settings, if the procwatch feels that the process is taking too long, or consuming too much memory, it will kill the process.

PHP is a poor way to handle uploads of this size. I recommend, if you cannot use traditional SFTP to transfer these files, you use something like uber-uploader, which passes the “heavy lifting” of the file-upload process to a perl script that is not encumbered with PHP’s overhead.

At some point, you will still have to contend with procwatch, but I have uploaded files over 200MB with uber-uploader on DreamHost in testing. Really though, files of this size are better transferred via SFTP.

I read through the e107 thread, and I don’t see that is related to the problem you are reporting (If a smaller .exe file succeeds!)



I actually thought of uber-uploader myself but I have basically zero real experience with PHP/Perl aside from very minor editing.

I’m not really sure how I would go about integrating its Perl uploading ability into the standard PHP uploading script included with e107. I guess I should ask the e107 folks about that.


That should be sufficient for installing uber-uploader - it’s no more difficult to install than e107 :wink:

I don’t know how to go about that either (it’s been several years since I have used e107). For such things, I’m kinda spoiled with the “quick and dirty” wrapper module of Joomla! (which works well for these kinds of “one off” mods).

I suspect that, if I felt it was only going to be occasionally used, I would not even bother to “integrate” it at all - I’d probably just link to it as a “standalone” application (and probably “wrap” it in the shell of a rendered e107 page so that it would “blend” with the site (which is the “lazy” way to go, I know). :wink:



I would consider that more “practical” than “lazy” :wink:


The only problem with the “practical” method you mention is the inability to attach the various title/description elements.

This is great though, the people on e107’s forums seem very, shall I say, apathetic, to any problem requiring more than a few sentences to explain. =/ If anyone here can help me, I’ll be more than happy to take it. Or maybe even suggestions of better Content Management Systems would work.


The best-supported is Joomla! imho.


Yeah, I understand. I suppose you could hack the form in uber-uploader to collect that additional info, and insert it into the appropriate MySQL table upon success of the upload, but that would taike a little PHP coding.

I agree with sxi that Joomla! seems to be the best supported FOSS CMS going at present. It will take a little getting used to if you are used to the Nukes, Xoops, e107, etc., but it is much more easily extended and has a huge amount of extensions already available.