[php-maint] Bug#685383: PHP cannot handle uploads bigger than 2GB

Vasil Kolev vasil at ludost.net
Mon Aug 20 11:23:16 UTC 2012

Package: php5
Version: 5.3.3-7+squeeze14
Tags: patch, upstream, lfs

PHP doesn't support uploads of files bigger than 2GB. It's a known bug
in upstream - https://bugs.php.net/bug.php?id=44522 - but the fix still
isn't in and there doesn't seem to be any answer.

Right now I'm running with the patch from above, tweaked a bit to apply
to the PHP in squeeze, which I'm attaching. A part of it (the conversion
from atoi() to atol() ) is already included in the php5 package in
testing (version 5.4.4-4) but the rest doesn't seem to be there. The
patch is kludgy and I'd agree to fix it up a bit if there's the
possibility to be accepted.

This is reproducible with setting in php.ini the upload_max_filesize to
something more than 2GB, post_max_size to the same value, having the
following code in a php file:

if (!move_uploaded_file($file['tmp_name'], "/tmp/testfile")) {
	echo "doesn't work";
} else {
	echo "works";


And running from somewhere 

dd if=/dev/zero of=bigf bs=1M count=4099
curl -F file=@bigf  'http://some.server.addr/upload.php'

(fixing the url to reflect the position of the php file)

As for the reason for this, a lot of sites (including mine) actually
need this kind of upload, as there's no good way to push files to it
otherwise (I've seen suggestions to use FTP) that the users can easily
use. With the proliferation of big video files, there's a lot of stuff
people want to upload which goes above these limits.

Vasil Kolev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: php.64bit.patch
Type: text/x-patch
Size: 6785 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20120820/36c40c92/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20120820/36c40c92/attachment.pgp>

More information about the pkg-php-maint mailing list