php接收post參數(shù)時(shí)報(bào)錯(cuò)的解決辦法:首先搜索【php.ini】中 【always_populate_raw_post_data 】;然后將前面的【;】去掉,并重啟服務(wù)即可。
php接收post參數(shù)時(shí)報(bào)錯(cuò)的解決辦法:
php接收postman數(shù)據(jù)時(shí)報(bào)錯(cuò)
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
網(wǎng)上查詢(xún)到的原因是:本地PHP版本過(guò)高,postman發(fā)過(guò)來(lái)的數(shù)據(jù)用$HTTP_RAW_POST_DATA 接收數(shù)據(jù)時(shí)報(bào)錯(cuò),改變$_POST的賦值方式就可以
搜索php.ini中 【always_populate_raw_post_data 】
將前面的【;】去掉,重啟服務(wù),就可以正常接收了,不過(guò)這一塊我目前也沒(méi)有很清楚,為什么在框架中,接收$_POST數(shù)據(jù)并沒(méi)有這個(gè)報(bào)錯(cuò),但是單獨(dú)的腳本接收數(shù)據(jù)時(shí)卻報(bào)錯(cuò)
相關(guān)免費(fèi)學(xué)習(xí)推薦:php編程(視頻)