当前位置: 移动技术网 > IT编程>开发语言>PHP > Automatically populating $HTTP_RAW_POST_DATA is deprecated

Automatically populating $HTTP_RAW_POST_DATA is deprecated

2018年10月23日  | 移动技术网IT编程  | 我要评论

重新搭建了一个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. in unknown on line 0

查找原因后,发现错误原因如下:
官方在php5.6就把$http_raw_post_data废弃了,而且在php7中把它移除了。因为这个参数影响性能,所以要废弃掉,官方建议用php://input来代替。

解决办法:
修改php.ini

always_populate_raw_post_data = -1

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网