微信环境的PHP版本升级7.0以上的一些坑

坑一:
微信支付Api.class.php 或 微信API :WxPay.Api.php 的 notify() 方法 支付结果通用通知 //获取通知的数据 // $xml = $GLOBALS['HTTP_RAW_POST_DATA']; $xml = file_get_contents("php://input"); // 开启openssl.dll扩展 升级完PHP7 发现微信支付回调失败。
坑二:
返回回事件消息失败和返回文本消息失败问题public function __construct 微信示例代码wxBizMsgCrypt.php里面的构造函数是用的类名,但php7不再支持类名作为构造函数,需要使用__construct,修改构造函数为__construct。 public function Prpcrypt修改为public function __construct public function WXBizMsgCrypt 修改为public function __construct

  

坑三:
// 获取微信推送过来的post数据(xml格式) // $postArr = $GLOBALS['HTTP_RAW_POST_DATA']; //接受post数据,PHP7废弃的全局变量 $postArr = file_get_contents("php://input");

  目前遇到过的 

 

posted @ 2018-04-06 22:53  Zel+_+  阅读(243)  评论(0编辑  收藏  举报