Question: I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables:

```none
memory_limit = -1
post_max_size = 9G
upload_max_filesize = 5G

```

However, in the error\_log I found:

> 
> PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0
> 
> 
> 

Can anyone tell me why this keeps failing please?

Answer: 
I don't know about in 5.3.x, but in 5.2.x there are some int/long issues in the PHP code. even if you're on a 64-bit system and have a version of PHP compiled with 64-bit, there are several problems.

First, the code that converts post\_max\_size and others from ascii to integer stores the value in an int, so it converting "9G" and putting the result into this int will bork the value because 9G is a larger number than a 32-bit variable can hold.

But there are also several other areas of PHP code that are used with the Apache module, CGI, etc. that need to be changed from int to long.

So...for this to work, you need to edit the PHP code and compile it by hand (make sure you compile it as 64-bit). here's a link to a list of diffs:

<http://www.archive.org/~tracey/downloads/patches/karmic-64bit-post-large-files.patch>

Referenced from this php bug post: <http://bugs.php.net/bug.php?id=44522>

The file above is a diff on 5.2.10 code, but I just made the changes by hand to 5.2.17 code and i just uploaded a 3.4gb single file through apache/php (which hadn't worked before the change).

ope that helps.
We've had the same problem: uploads stopped at 2GB.

Under SLES (SUSE Linux Enterprise Server) 11 SP 2, php53 was the problem.

Then we added a new repository that has php54:
<http://download.opensuse.org/repositories/server:/php/SLE_11_SP2/>

and upgraded to that, we now can upload 5GB :-)