This problem seems directly related to the infamous 2GB limit and I\'m not sure at this atge if its a 32bit PHP issue. I\'ve seen the comments related to HTTP not being desi
The question is why would you use your browser to upload > 1GB. Consider top file sharing services most limit file upload size to 1GB via browser. What happens if user-download fails you would have to restart the whole process.
Have you looked in to alternatives if you have such large file uploads, torrents, ftp or personal upload client like rapidshare, fileupload, megaupload etc. Have.
You are limited because of the file size limit set to POST's. If you are determined to use HTTP to upload bigger files which i would discourage, the optimal solution would be spliting the file and uploading the smaller splited parts then reassembling the file.
If you have access to the apache virtualhost config you can also change these settings for a specific upload URL (you can also add this to your .htaccess file):
With this code:
<LocationMatch "/index.php/url-of-your-upload.php">
php_value max_execution_time 0
php_value upload_max_filesize 0
php_value post_max_size 4939212390
php_value memory_limit 4G
LimitRequestBody 0
</LocationMatch>
The LocationMatch directives allow you to choose the url (you can use reg exp)
Have solved this issue, so thanks to @BogdanBurim for suggesting the back to basics approach:
I have managed to upload a 3.8 GB file over HTTP with the following settings:
In Apache2 I've set the following:
- apache2.conf I've set Timeout to 900
- httpd.conf I've set LimitRequestBody to 0
- .htaccess in the file upload directory I've set:
- LimitRequestBody to 0
- php_value upload_max_filesize 0
- php_value post_max_size 4939212390
- .htaccess in the php temp directory (in my case its /tmp/) I've set:
- LimitRequestBody to 0
- php_value upload_max_filesize 0
- php_value post_max_size 4939212390
In php.ini I've set the following:
- UPLOAD_MAX_FILESIZE 0
- POST_MAX_SIZE 4939212390
- max_execution_time 120
- max_input_time 60
- memory_limit 128M
The only other important part of this solution was having to remove the MAX_FILE_SIZE, HTML from the upload form:
<input type="hidden" name="MAX_FILE_SIZE" value="4939212390" />
Having this set continually caused a PHP type 2 error, so php couldn't handle the greater than 32bit integer that is set. Removing it caused PHP type 1 errors until I changed the UPLOAD_MAX_FILESIZE to 0 everywhere and hey presto it now works!!!!
http://php.net/manual/en/features.file-upload.errors.php