调试微信支付发生错误

错误1:

A PHP Error was encountered
Severity: Warning
Message: fopen(/tmp/logs/2018-05-30.log): failed to open stream: No such file or directory
Filename: lib/log.php
Line Number: 16

解决方法:在硬盘的根目录下新建 tmp/logs/ 文件夹,不是在网站根目录下新建文件夹

错误2:

An uncaught Exception was encountered
Type: WxPayException
Message: curl出错,错误码:60
Filename: D:\wwwroot\wanaiweb\wanai\application\third_party\wxpay\lib\WxPay.Api.php
Line Number: 564

修改文件 WxPay.Api.php 解决:

第537行

curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);//严格校验

改为

curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,FALSE);//严格校验2

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注