php关于always_populate_raw_post_data报错的解决方案
问题
当你在维护项目时候遇到如下问题:
always_populate_raw_post_data报错,报错内容是"不建议使用$HTTP_RAW_POST_DATA",如图所示:
Invalid JSON:
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
方法
1 通过修改php.ini配置文件:
2 或者直接升级到php7,官方说明: 点我打开