運行PHP項目時,一直彈出這個提示
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
解決方法:
php.ini文件下:開啟always_populate_raw_post_data = -1 之后保存重啟即可
原因:開啟后就可以用 $HTTP_RAW_POST_DATA 接收data,不過通常我們使用 php://input