最近做了一个程序,部署在 SAE 上,环境是 PHP 5.6。
今天看了一下 SAE 上的日志,debug 中上万条日志提示:
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.
因为我这个程序是和微信公众号对接的,微信会把消息体以 XML 的结构 POST 到我这边,所以我现在使用 file_get_contents('php://input') 来获取消息。
不知道是不是我对这条 debug 理解有问题,说的应该是推荐用 php://input 吧?但怎么还每一次都有警告呢?
难道 5.6 之后不推荐这个方式了?那用什么方式来代替呢?谢谢~