PHP Warning: POST Content-Length of 8978294 bytes

2019-01-02 20:34发布

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

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

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

Any ideas?

15条回答
回忆,回不去的记忆
2楼-- · 2019-01-02 20:35
  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. 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

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

  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.

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

查看更多
查无此人
3楼-- · 2019-01-02 20:36

Just set these in php.ini:

upload_max_filesize = 1000M;
post_max_size = 1000M;
查看更多
回忆,回不去的记忆
4楼-- · 2019-01-02 20:38

Go to

C:\drive\xampp(where xampp installed)

simply find php.ini file then in the file search

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

查看更多
低头抚发
5楼-- · 2019-01-02 20:40

You also need the change post-max-size.

查看更多
流年柔荑漫光年
6楼-- · 2019-01-02 20:42

Using wamp do the following and hopefully it will resolve issue

Make these changes in PHP Options to correct:

max_execution_time 180

memory_limit 512M or your highest available

post_max_size 32M

upload_max_filesize 64M

查看更多
不再属于我。
7楼-- · 2019-01-02 20:44

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

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

So you can set upload_max_filesize to 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_size was set to 5.

查看更多
登录 后发表回答