always_populate_raw_post_data = -1报错问题解决办法

我们的web服务器由Apache换成了ngix运行出现如下图错误

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

猜你喜欢

转载自blog.csdn.net/stand_forever/article/details/85266177