POST 167289889 字节的内容长度超出了 41943040 字节的限制

POST Content-Length of 167289889 bytes exceeds the limit of 41943040 bytes

我在上传 pdf 文件时收到这条消息,我在 php.ini

中更改了以下值
post_max_size=5000M

upload_max_filesize=1000M

max_file_uploads=1000M

并在 php 文件中:

ini_set('upload_max_filesize', '600M');
ini_set('post_max_size', '600M');
header("Content-length: 167289889");

但我仍然得到这个错误:

POST Content-Length of 167289889 bytes exceeds the limit of 41943040 bytes

php v : 7.4.11

您还应该在 httpd.conf 或 apache.conf 中检查您的 apache 配置,或者检查您可能用于以下属性的其他一些 *.conf 文件

LimitRequestBody

通常它被设置为 0,这是无限制的,但在您的服务器上它可能有自己的限制