相关疑难解决方法(0)

关于不推荐使用`$ HTTP_RAW_POST_DATA`的警告

我切换到PHP 5.6.0,现在到处都收到以下警告:

Deprecated: 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. in Unknown on line 0

Warning: Cannot modify header information - headers already sent in Unknown on line 0
Run Code Online (Sandbox Code Playgroud)

好吧,我依靠一些不赞成的功能.除了我没有!

  1. 我没有在任何脚本中使用过这个变量.说实话,我不知道它甚至存在.
  2. phpinfo()显示我已always_populate_raw_post_data设置为0(禁用).那么发生了什么?

我不想通过将此值设置为-1来"避免警告".这只会隐藏警告,我仍然会弃用配置.我想从源头解决问题,并知道为什么PHP认为HTTP_RAW_POST_DATA填充是打开的.

php migration configuration

117
推荐指数
6
解决办法
10万
查看次数

标签 统计

configuration ×1

migration ×1

php ×1