Problems encountered when php WeChat payment develops official sdk deployment curl error code 60

Original:  http://www.cnblogs.com/txw1958/p/wxpay-curl-error.html

2. curl error code 60

The scene appears

The following is the error code when running the WeChat payment test code:

 

Fatal error: Uncaught exception ‘WxPayException‘ with message ‘curl出错,错误码:60‘ in C:\wwwroot\fangbei\lib\WxPay.Api.php:564 Stack trace: #0 C:\wwwroot\fangbei\lib\WxPay.Api.php(62): 
WxPayApi::postXmlCurl(‘<xml><appid><![...‘, ‘https://api.mch...‘, false, 6) #1 C:\wwwroot\fangbei\pay\jsapi.php(36): 
WxPayApi::unifiedOrder(Object(WxPayUnifiedOrder)) #2 {main} thrown in C:\wwwroot\fangbei\lib\WxPay.Api.php on line 564

Cause Analysis

Certificate verification failed

Solution

line 538

curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE);
curl_setopt( $ch ,CURLOPT_SSL_VERIFYHOST,2); // strict verification

change into

curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt( $ch ,CURLOPT_SSL_VERIFYHOST, FALSE ); // strict verification

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326444259&siteId=291194637