奇怪的PHP错误,它来自哪里?笨

use*_*916 3 php codeigniter

今天我正在为头像制作文件上传,一切都很好,它调整图像大小等,但偶尔选择一个大而无效的文件时会产生这个错误:

Warning: POST Content-Length of 52091839 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
You did not select a file to upload.
Run Code Online (Sandbox Code Playgroud)

这种情况并不是偶尔发生的.通常它只是在文件太大时给出正确的错误消息.

有没有人知道这个错误来自哪里,为什么它显示?

谢谢!

Mic*_*ski 5

听起来你需要增加post_max_sizephp.ini.如果你还没有增加upload_max_filesize,你可能也需要增加它.

# php.ini
# Allow huge files:
# Post usually needs to be bigger than file upload size!
post_max_size = 256M
upload_max_filesize 128M
Run Code Online (Sandbox Code Playgroud)