当我试图在XAMPP本地开发环境的WordPress上上传导入时,我得到了这个错误:

警告:POST Content-Length的8978294字节超过了第0行Unknown中的8388608字节的限制

我将upload_max_filesize从2M更改为1000M,但这似乎没有任何作用。

什么好主意吗?


当前回答

打开浏览器,搜索php.ini,然后打开它,修改这两个值:

post_max_size= 1000000000000M
upload_max_filesize= 10000000000000M

如果你使用记事本打开php.ini文件,你可以通过点击搜索这两个值: CMD + f

其他回答

你还需要更改post-max-size。

已经重新启动了您的web服务器?

这将迫使php重新加载php.ini

我已经解决了我的php7问题在centos 7更新/etc/php.ini与这些设置:

 post_max_size = 500M
 upload_max_filesize = 500M
upload_max_filesize = 8M;
post_max_size = 8M;

假设您已经更改了上面的值。但是当用户试图上传大于8M的大文件时会发生什么?

这就是发生的事情,PHP显示了这个警告!

Warning: POST Content-Length of x bytes exceeds the limit of y bytes in Unknown on line 0

你可以通过添加来避免它

ob_get_contents();
ob_end_clean();

在XAMPP面板中,单击Apache站点上的ADMIN按钮。 然后选择编辑php.ini 并将缺失的post_max_size添加到您喜欢的值中。

post_max_size = 100M