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
我做小例子的時候報這種錯誤,網上都說是把always_populate_raw_post_data' 設定成 '-1',但是我去php.ini裡面看了,預設的設定就是-1。哪位大神能夠指點一下
回複討論(解決方案)
Deprecated 中文釋義:過時的
顯然你的 php 版本比較高
在高版本 php 的發版說明中都有 $HTTP_RAW_POST_DATA 即將(已經)取消,請改用從 php://input 中讀取 的聲明
設原來是 $s = $HTTP_RAW_POST_DATA;
應寫作 $s = file_get_contents('php://input');
多打幾個字而已
$HTTP_RAW_POST_DATA 這個被廢棄了,在將來的php版本中還會移除。
讓你用 php://input 代替
$GLOBALS['HTTP_RAW_POST_DATA'] 我是用這個寫法
This feature has been DEPRECATED as of PHP 5.6.0. Relying on this feature is highly discouraged.
$HTTP_RAW_POST_DATA 包含 POST 提交的未經處理資料。
一般而言,使用 php://input 代替 $HTTP_RAW_POST_DATA。
並沒有用到¥GTTP_RAW_POST_DATA...我只是用到了POST方法
$HTTP_RAW_POST_DATA 已經廢棄了
應該用 file_get_contents('php://input');來擷取
$GLOBALS['HTTP_RAW_POST_DATA']也一樣
說不定一升級版本HTTP_RAW_POST_DATA讀出來就空了
全域替換成file_get_contents('php://input') 就行了
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
表示$HTTP_RAW_POST_DATA 已經廢棄了,所以應該使用file_get_contents('php://input');來擷取
應該是phpstorm破解版不能使用post方法