Uploading a file larger than 2GB using PHP

前端 未结 6 1958
情歌与酒
情歌与酒 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:39

    As phliKtid mentioned, this is a limitation with the PHP framework. Save for editing the source code as mentioned in the bug report phliKtid linked, there is a workaround that involves setting the upload_max_filesize to 0 in the php.ini file.

    ; Maximum allowed size for uploaded files.
    ; http://php.net/upload-max-filesize
    upload_max_filesize = 0
    

    By doing this, PHP will not crash when trying to convert "5G" into a 32-bit integer and you will be able to upload files as big as you allow with the "post_max_size" variable.

提交回复
热议问题