The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't upload file >2GB using PHP

Discussion in 'General Discussion' started by Reado, Jan 6, 2011.

  1. Reado

    Reado Well-Known Member

    Joined:
    Sep 8, 2009
    Messages:
    161
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    United Kingdom
    cPanel Access Level:
    DataCenter Provider
    I'm trying to upload a file larger than 2GB. I've set the following server variables using the PHP config editor:

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

    However in the error_log I find:

    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?
     
  2. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    If you are running Apache 1.3.x or 2.0.x then you cannot work around the 2.0GB file limit, as this is something the webserver itself cannot handle due to 32bit register limits. Apache 2.2.x has changed this by using 64bit file registers so you must upgrade to that in order to handle >2GB files. Your LimitRequestBody should also be set to 0 (unlimited) after upgrading as well.

    I would also like to mention that web-based uploads of such large files is not a superb idea. HTTP is a stateless protocol and doesn't handle connection interruptions gracefully. Of course that's just my 2¢!
     
Loading...

Share This Page