简体   繁体   English

PHP Xampp POST 内容长度

[英]PHP Xampp POST Content-Length

Hi and thank you for reading this.您好,感谢您阅读本文。

I am faced with the following error when I POST pdf file to the server:当我将 pdf 文件发布到服务器时,我遇到以下错误:

Warning: POST Content-Length of 9353594 bytes exceeds the limit of 8388608 bytes in Unknown on line 0警告:9353594 字节的 POST 内容长度超过第 0 行未知中 8388608 字节的限制

Fatal error: Uncaught RuntimeException: Unexpected data in output buffer.致命错误:未捕获的 RuntimeException:output 缓冲区中有意外数据。 Maybe you have characters before an opening finalize(Object(Slim\Http\Response)) #1 D:\1.WORK\CreditSmart\AngularProjects\creditcover_backend\public\index.php(32): Slim\App->run() #2 {main} thrown in D:\1.WORK\CreditSmart\AngularProjects\creditcover_backend\vendor\slim\slim\Slim\App.php on line 625也许您在打开 finalize(Object(Slim\Http\Response)) #1 D:\1.WORK\CreditSmart\AngularProjects\creditcover_backend\public\index.php(32): Slim\App->run() 之前有字符#2 {main} 在第 625 行的 D:\1.WORK\CreditSmart\AngularProjects\creditcover_backend\vendor\slim\slim\Slim\App.php 中抛出

I use Slim PHP and I have set the post_max_size=5000M and also upload_max_filesize=20000M but I still get the error.我使用 Slim PHP 并且设置了post_max_size=5000Mupload_max_filesize=20000M但仍然出现错误。 Why is that?这是为什么?

Thank you for the help.感谢您的帮助。

In phpinfo check which php.ini is used and edit the correct php.ini as in the phpinfo and set the following value or something desired bigger value.在 phpinfo 中检查使用了哪个 php.ini 并在 phpinfo 中编辑正确的 php.ini 并设置以下值或所需的更大值。 8388608 bytes is 8M, the default limit in PHP. 8388608 字节为 8M,PHP 中的默认限制。 Update your post_max_size in php.ini to a larger value.将 php.ini 中的 post_max_size 更新为更大的值。

upload_max_filesize = 1000M; <-- as per your need
post_max_size = 1000M; <-- as per your need

Restart your webserver and see first if value has been changed or not.重新启动您的网络服务器,首先查看值是否已更改。 If value is changed then you should not have a problem.如果值更改,那么您应该没有问题。

I found the problem.我发现了问题。 On my windows I have PHP7 installed.在我的 windows 上,我安装了 PHP7。 My Xampp also has PHP but it is not the one my system uses.我的 Xampp 也有 PHP 但它不是我的系统使用的那个。 I just had to configure the correct PHP config file.我只需要配置正确的 PHP 配置文件。 Now everything works fine.现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM