Stackoverflow热门问题(二十四)-PHP Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

stackoverflow热门问题目录

如有翻译问题欢迎评论指出,谢谢。

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

  • novicePrgrmr asked:
    • 我在本地XAMPP环境上传文件到WordPress时发生了错误:
    • Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
    • 即便将 upload_max_filesize 从2M改为1000M也没有解决。
    • 有其他解决办法吗?
  • Answers:
    • Fluffeh - vote: 384
      • 8388608B是8M,PHP的默认限制。更新php.ini的post_max_size成一个更大的值可以解决。
      • upload_max_filesize设置用户能上传的单文件大小限制,post_max_size则是表示一次POST上传的最大数据量。
      • 所以将upload_max_filesize设为1M,可以使得用户能上传的最大单文件大小变为1M,如果post_max_size设为5,那么就能上传5个最大文件。
      • 改变设置后需要重启服务器生效。
    • Altab Hossen - vote: 69
      • 这样更改php.ini的设置即可:
      • upload_max_filesize = 1000M;
        post_max_size = 1000M;
    • Muhammad Tahseen Ur Rehman - vote: 32
      • 1. 找到php.ini
        1. php.ini 文件在 C:\xampp\php 或者 xampp 文件夹。
      • 2. 打开并改变php.ini的设置:

        1. post-max-size (8M 改为 800M).
        2. upload-max-filesize (2M 改为 2000M).

      • 3. 停止Apache和MySQL。
      • 4. 重启Apache和MySQL
      • 这样就解决了。
      • 🙂

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

  • novicePrgrmr asked:
    • 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
    • I changed the upload_max_filesize from 2M to 1000M, but that didn\'t seem to do anything.
      即便将 upload_max_filesize 从2M改为1000M也没有解决。
    • Any ideas?
      有其他解决办法吗?
  • Answers:
    • Fluffeh - vote: 384
      • 8388608 bytes is 8M, the default limit in PHP. Update your post_max_size in php.ini to a larger value.
        8388608B是8M,PHP的默认限制。更新php.ini的post_max_size成一个更大的值可以解决。
      • 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.
        upload_max_filesize设置用户能上传的单文件大小限制,post_max_size则是表示一次POST上传的最大数据量。
      • 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.
        所以将upload_max_filesize设为1M,可以使得用户能上传的最大单文件大小变为1M,如果post_max_size设为5,那么就能上传5个最大文件。
      • Changes will take effect after a restart of the server.
        改变设置后需要重启服务器生效。
    • Altab Hossen - vote: 69
      • Just set these in php.ini:
        这样更改php.ini的设置即可:
      • upload_max_filesize = 1000M;
        post_max_size = 1000M;
    • Muhammad Tahseen Ur Rehman - vote: 32
      • 1. First u will find the php.ini file.
        找到php.ini
        1. u can find php.ini file from this path. C:\xampp\php or from xampp folder.
          php.ini 文件在 C:\xampp\php 或者 xampp 文件夹。
      • 2. Now open php.ini file and change the following:
        打开并改变php.ini的设置:

        1. post-max-size (change 8M to 800M).
        post-max-size (8M 改为 800M).
        2. upload-max-filesize (change 2M to 2000M).
        upload-max-filesize (2M 改为 2000M).

      • 3. Now stop the Apache server and MySQL.
        停止Apache和MySQL。
      • 4. Now restart Apache server and MySQL.
        重启Apache和MySQL
      • It worked fine after that.
        这样就解决了。
      • Enjoy ur working now 🙂
        🙂

版权声明:
作者:MWHLS
链接:http://panwj.top/2912.html
来源:无镣之涯
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
< <上一篇
下一篇>>