+
81
-

php出现 $HTTP_RAW_POST_DATA is deprecated and will be removed

php

开发的时候出现这个提示,怎么办?

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.

网友回复

+
0
-
always_populate_raw_post_dat如果设置为true,PHP将始终填充包含原始日志数据的$HTTP_RAW_POST_DATA。否则,只有当数据的mime类型不被识别时,变量才会被填充。
访问原始日志数据的首选方法是php://input,在php 5.6.0以后的版本中不推荐使用$HTTP_RAW_POST_DATA。将always-populate-raw-post-data设置为-1将选择在将来的PHP版本中实现的新行为,在该版本中从未定义$HTTP_RAW_POST_DATA。
无论设置如何,$http_raw_post_data不可用于enctype=“multipart/form data”。
我知道答案,我要回答