在调试的时候出现警报: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version.
导致一直公众号一直解密失败:
成功或失败:
Decrypt Fail!
错误原因:
Xml fields error, please check your response xml!
解决方法:
在php.ini里面把always_populate_raw_post_data修改为-1
重启php-fpm
然后就可以了。
注意公众号返回消息是xml格式用echo xxx;
另外微信还提供还有测试号:https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login
提供了在线调试工具 :开发 =>开发者工具 =>在线接口调试工具=>接口类型:消息接口调试