Uploading a file larger than 2GB using PHP

前端 未结 6 1950
情歌与酒
情歌与酒 2020-12-01 16:50

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:

         


        
6条回答
  •  离开以前
    2020-12-01 17:28

    I had a similar problem, but my config was:

    post_max_size = 1.8G
    upload_max_filesize = 1.8G
    

    and yet I could not upload a 1.2GB file. The error was very same:

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

    I spent a day wondering where the heck was this "limit of 1073741824" coming from!

    Solution:

    Actually, the error was in the php.ini parser: It only understands INTEGER numbers, so essentially it was parsing 1.8G as 1G !!

    Changing the value to e.g. 1800M fixed it.

    Pls ensure to restart the apache server with the below command service apache2 restart

提交回复
热议问题