所属分类:php教程
php在接收post传参时出错解决办法:
php接收post数据时报错
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版本过高导致post发过来的数据用$HTTP_RAW_POST_DATA 接收数据时报错,改变$_POST的赋值方式就可以,这时可以通过搜索php.ini中参数always_populate_raw_post_data 将前面的;去掉,然后重启服务即可。