PHP 警告:8978294 字节的 POST Content-Length 超出了第 0 行未知中 8388608 字节的限制

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11719495/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 01:56:40  来源:igfitidea点击:

PHP Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

wordpressxamppphp

提问by novicePrgrmr

I am getting this error when trying to upload an import on WordPress on my XAMPP local dev environment:

在我的 XAMPP 本地开发环境中尝试在 WordPress 上上传导入时出现此错误:

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

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

I changed the upload_max_filesizefrom 2Mto 1000M, but that didn't seem to do anything.

我将upload_max_filesizefrom更改2M1000M,但这似乎没有任何作用。

Any ideas?

有任何想法吗?

回答by Fluffeh

8388608 bytes is 8M, the default limit in PHP. Update your post_max_sizein php.ini to a larger value.

8388608 字节为 8M,PHP 中的默认限制。将您post_max_size的 php.ini更新为更大的值。

upload_max_filesizesets the max file size that a user can upload while post_max_sizesets the maximum amount of data that can be sent via a POST in a form.

upload_max_filesize设置用户可以上传的最大文件大小,同时 post_max_size设置可以通过表单中的 POST 发送的最大数据量。

So you can set upload_max_filesizeto 1 meg, which will mean that the biggest single file a user can upload is 1 megabyte, but they could upload 5 of them at once if the post_max_sizewas set to 5.

所以你可以设置upload_max_filesize为 1 兆,这意味着用户可以上传的最大单个文件是 1 兆字节,但如果post_max_size设置为 5 ,他们可以一次上传 5个。

回答by Altab Hossen

Just set these in php.ini:

只需在 php.ini 中设置这些:

upload_max_filesize = 1000M;
post_max_size = 1000M;

回答by Mihai Stancu

That's an 8MB post_max_sizeerror.

这是一个 8MB 的post_max_size错误。

Set it to a value you're comfortable with.

将其设置为您感到满意的值。

回答by Muhammad Tahseen Ur Rehman

1.First u will find the php.ini file.

1.首先你会找到 php.ini 文件。

u can find php.inifile from this path. C:\xampp\phpor from xamppfolder.

你可以从这个路径找到php.ini文件。 C:\xampp\php或来自 xampp文件夹。

2.Now open php.ini file and change the following:

2.现在打开 php.ini 文件并更改以下内容:

1.post-max-size(change 8Mto 800M).

2.upload-max-filesize(change 2Mto 2000M).

1. post-max-size(将8M改为800M)。

2.上传-MAX,文件大小(变2M2000M)。

3.Now stop the Apache server and MySQL.

3.现在停止 Apache 服务器和 MySQL。

4.Now restart Apache server and MySQL.

4.现在重启 Apache 服务器和 MySQL。

It worked fine after that.

在那之后它工作得很好。

Enjoy ur working now :)

享受你现在的工作:)

回答by MarcDefiant

Already restarted your Webserver?

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

This will force php to reload the php.ini

这将强制 php 重新加载 php.ini

回答by Joel

You will have to change the value of

你将不得不改变的价值

post-max-size
upload-max-filesize

both of which you will find in php.ini

两者都可以在php.ini 中找到

Restarting your server will help it start working. On a local test server running XAMIP, i had to stop the Apache server and restart it. It worked fine after that.

重新启动您的服务器将有助于它开始工作。在运行 XAMIP 的本地测试服务器上,我不得不停止 Apache 服务器并重新启动它。在那之后它工作得很好。

回答by abdessamad wassim

Go to C:\xamppp\php. Set these values in php.ini:

C:\xamppp\php。在 php.ini 中设置这些值:

upload_max_filesize = 1000M
post_max_size = 0M

回答by Sad Dam

  1. Create new text file in our wp-admin directory root and name it info.php.
  2. Open info.php and add these lines:
  1. 在我们的 wp-admin 目录根目录中创建新的文本文件并将其命名为 info.php。
  2. 打开 info.php 并添加以下几行:
  1. Save it.
  2. Go to yourwebsitename(probably localhost)/wp-admin/info.php in any web-browser.
  3. In the 8th line you will see: Configuration File (php.ini) Path, in my case it is C:\Windows, meaning it is located on my C drive.
  4. In the 9th line you will see: Loaded Configuration File, and next to it is written C:\xampp\php.ini
  1. 保存。
  2. 在任何网络浏览器中转到您的网站名称(可能是本地主机)/wp-admin/info.php。
  3. 在第 8 行,您将看到:配置文件 (php.ini) 路径,在我的情况下是 C:\Windows,这意味着它位于我的 C 驱动器上。
  4. 在第 9 行你会看到:Loaded Configuration File,旁边写着 C:\xampp\php.ini

So I found my php.ini page that is associated with my wordpress web-site.

所以我找到了与我的 wordpress 网站相关联的 php.ini 页面。

  1. Go to that path, and find php.ini.
  2. Open it, and edit: Search for post_max_size=8M, and change it to post_max_size=1000M Search for upload_max_filesize=2M, and change it to upload_max_filesize=1000M

  3. Go back to your admin page>Media>Add New

  4. On the bottom you will see that 2MB has changed to 1000M.
  1. 转到该路径,并找到 php.ini。
  2. 打开,编辑:搜索post_max_size=8M,改成post_max_size=1000M 搜索upload_max_filesize=2M,改成upload_max_filesize=1000M

  3. 返回您的管理页面>媒体>添加新

  4. 在底部您会看到 2MB 已更改为 1000M。

Once you done this process then you must restart your computer or just restart the XAMPP...

完成此过程后,您必须重新启动计算机或仅重新启动 XAMPP ...

回答by Khubaib Raza

Go to

C:\drive\xampp(where xampp installed)

simply find php.ini file then in the file search

只需找到 php.ini 文件,然后在文件搜索中

post_max_size=XXM
upload_max_size=XXM

Change with this code

使用此代码更改

post_max_size=100M
upload_max_filesize=100M

Don't forget to restart the xampp

不要忘记重新启动xampp

回答by Enaan Farhan

  1. Find php.ini [\xampp\php]
  2. Just set these in php.ini:
  1. 找到 php.ini [\xampp\php]
  2. 只需在 php.ini 中设置这些:
upload_max_filesize = 1000M;
post_max_size = 1000M;
  1. Rebot server
    • Stop Apache and MySQL
    • Start again Apache and MySQL
  1. 机器人服务器
    • 停止 Apache 和 MySQL
    • 重新启动 Apache 和 MySQL