Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Can't upload file >2GB using PHP

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

  1. Reado

    Reado Well-Known Member

    Sep 8, 2009
    Likes Received:
    Trophy Points:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    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

    Jun 18, 2004
    Likes Received:
    Trophy Points:
    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¢!
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice