[TOC]
### 错误一:
```
cURL error 60: SSL certificate problem: unable to get local issuer certificate
```
答:微信要求开启 https,否则无法用!
### 错误二:错误码:60
```
Fatal error: Uncaught exception 'WxPayException' with message 'curl出错,错误码:60' in C:\project\www.sxqibo.com\demo\WxpayAPI_php_v3\lib\WxPay.Api.php on line 564
WxPayException: curl出错,错误码:60 in C:\project\www.sxqibo.com\demo\WxpayAPI_php_v3\lib\WxPay.Api.php on line 564
```
![mark](http://qiniu.newthink.cc/blog/20170918-225536560.png)
**原因分析:** curl 问题
**解决方案:**
`lib\WxPay.Api.php` 下
```
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);//严格校验
```
### 错误三: 错误码:58
![mark](http://qiniu.newthink.cc/blog/20170919-195008750.png)
**原因分析:**证书路径错误
**解决方法:**
windows服务器上证书路径使用绝对路径。
```
curl_setopt($ch, CURLOPT_SSLCERT, dirname(__FILE__).'cert'.DIRECTORY_SEPARATOR.'apiclient_cert.pem');
curl_setopt($ch, CURLOPT_SSLKEY, dirname(__FILE__).'cert'.DIRECTORY_SEPARATOR.'apiclient_key.pem');
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__).'cert'.DIRECTORY_SEPARATOR.'rootca.pem');
```
Linux上使用相对路径
```
curl_setopt($ch, CURLOPT_SSLCERT, 'cert'.DIRECTORY_SEPARATOR.'apiclient_cert.pem');
curl_setopt($ch, CURLOPT_SSLKEY, 'cert'.DIRECTORY_SEPARATOR.'apiclient_key.pem');
curl_setopt($ch, CURLOPT_CAINFO, 'cert'.DIRECTORY_SEPARATOR.'rootca.pem');
```