微信支付出现“curl出错,错误码:60”,抛出异常的完整信息如下:
- Fatal error: Uncaught exception 'WxPayException' with message 'curl出错,错误码:60' in D:\Web\www\aliwords\pay\lib\WxPay.Api.php:564 Stack trace: #0 D:\Web\www\aliwords\pay\lib\WxPay.Api.php(62): WxPayApi::postXmlCurl('<xml><appid><![...', 'https://api.mch...', false, 6) #1 D:\Web\www\aliwords\pay\example\WxPay.NativePay.php(52): WxPayApi::unifiedOrder(Object(WxPayUnifiedOrder)) #2 D:\Web\www\aliwords\pay\example\native.php(43): NativePay->GetPayUrl(Object(WxPayUnifiedOrder)) #3 {main} thrown in D:\Web\www\aliwords\pay\lib\WxPay.Api.php on line 564
复制代码 解决方法很简单,在微信支付文件夹中找到WxPay.Api.php,打开文件,查找- curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE);
复制代码 替换为- curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
复制代码 然后查找- curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);
复制代码 替换为- curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
复制代码 搞定,收工。 |
|