POST Content-Length exceeds the limit

后端 未结 9 2366
盖世英雄少女心
盖世英雄少女心 2020-11-27 11:26

I get similar errors in my error_log in php when users are uploading their files

PHP Warning: POST Content-Length of 11933650 bytes exceeds the limi

9条回答
  •  日久生厌
    2020-11-27 12:13

    post_max_size should be slightly bigger than upload_max_filesize, because when uploading using HTTP POST method the text also includes headers with file size and name, etc.

    If you want to successfully uppload 1GiB files, you have to set:

    upload_max_filesize = 1024M
    post_max_size = 1025M
    

    Note, the correct suffix for GB is G, i.e. upload_max_filesize = 1G.

    No need to set memory_limit.

提交回复
热议问题