php5.6版本部分ajax错误HTTP_RAW_POST_DATA is deprecated头部错误原因

 

打网站显示错误:

Uncaught SyntaxError: Unexpected token < in JSON at position 0

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

 

Uncaught exception 'think\exception\ErrorException' with message 'include(): Filename cannot be empty' in

 

引用JSON数据显示不出来

php5.6版本部分ajax Automatically populating $HTTP_RAW_POST_DATA (Unexpected token  in JSON at position)_配置文件

 

解决办法:

打开php.ini配置文件,找到以下代码

;always_populate_raw_post_data = -1

改成

always_populate_raw_post_data = -1