我最近我的生產服務器升級到Ubuntu 14.04和PHP 5.6,現在我得到我的錯誤日誌中警告:
2014/10/31 10:42:45 [error] 17128#0: *46238 FastCGI sent in stderr: "PHP message: 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" while reading response header from upstream, client: 24.123.216.42, server: example.com, request: "POST /api/notes HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "example.com", referrer: "https://example.com/admin/"
我read the documentation以及這個有點相關的問題:Undefined variable: HTTP_RAW_POST_DATA。但是,我無法弄清楚爲什麼會記錄此通知。據我所知,我沒有在我的代碼庫中的任何地方使用$HTTP_RAW_POST_DATA
。我已經試過:
find . -exec grep "HTTP_RAW_POST_DATA" {} \; -print 2>/dev/null
從我的項目(包括所有的供應商目錄)的根目錄下,但我沒有找到任何匹配。
I read more about always_populate_raw_post_data
而且看起來$HTTP_RAW_POST_DATA
只應在always_populate_raw_post_data
參數設置爲TRUE時填充。我檢查了我phpinfo()
和參數設置爲0。
如果我沒有明確調用$HTTP_RAW_POST_DATA
和always_populate_raw_post_data
設置爲0
,爲什麼當我在我的錯誤日誌這些通知?什麼設置always_populate_raw_post_data
到-1
呢?
它可能被埋在服務器的配置文件中。 – 2014-10-31 16:25:13
我想過這個。我運行了一個'find/etc/nginx -exec grep「always_populate_raw_post_data」{} \; -print 2>/dev/null',但沒有結果。另外,它在'phpinfo()'中顯示爲'0'。 – 2014-11-03 20:54:33
你知道演習,創建最小的代碼來重現問題。 – 2014-11-06 21:25:34