laravel 错误 $HTTP_RAW_POST_DATA 已弃用,请改用 php://input 流。”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27107686/
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-09-14 10:27:59  来源:igfitidea点击:

Error $HTTP_RAW_POST_DATA is deprecated, use the php://input stream instead."

phplaravellaravel-4mamp

提问by Shlomo

Using PHP 5.6.2 on MAMP. I upgraded Laravel from 4.1 to 4.2, after fixing some errors and changes as described in Laravel's upgrade docs, I finally get this error:

在 MAMP 上使用 PHP 5.6.2。我将 Laravel 从 4.1 升级到 4.2,在修复了 Laravel 升级文档中描述的一些错误和更改后,我终于收到了这个错误:

"Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead."

"Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead."

Why is that? Where should I change any code? I am not using $HTTP_RAW_POST_DATAanywhere in my code.

这是为什么?我应该在哪里更改任何代码?我没有$HTTP_RAW_POST_DATA在我的代码中的任何地方使用。

I also changed my php.ini as stated, same error... How can I solve this?

我也按照说明更改了我的 php.ini,同样的错误......我该如何解决这个问题?

采纳答案by Shlomo

The solution to this problem was editing the right php.ini. Then everything worked.

这个问题的解决方案是编辑正确的php.ini. 然后一切正常。

回答by Kaushik solanki

Please use :

请用 :

Content-Type = application/x-www-form-urlencoded 

To solve this issue.

为了解决这个问题。