网页提示错误信息:
curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead in \192.168.200.150WWWwxdevelopcitygamejssdk.php on line 120
在网页调试能够获取到access_token,但是通过curl却获取不到,是不是因为我们的服务的问题,ssl安全校验失败,如何解决,请大神解答
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$this->appId&secret=$this->appSecret";
貌似是缺少证书所致,你可以主动设置
CURLOPT_SSL_VERIFYHOST
的值为false
,来禁用检查,不推荐。推荐的操作是到
curl
官网下载CA证书并导入到你的系统中即可,证书下载地址:https://curl.haxx.se/ca/cacert.pem,相关说明:https://curl.haxx.se/docs/caextract.html。关于该问题,你可以参考php文档中的用户留言:http://php.net/manual/en/function.curl-setopt.php#110457