Home  >  Article  >  php教程  >  php curl登陆qq后获取用户信息时证书错误,curl用户信息

php curl登陆qq后获取用户信息时证书错误,curl用户信息

WBOY
WBOYOriginal
2016-06-13 09:15:45830browse

php curl登陆qq后获取用户信息时证书错误,curl用户信息

今晚开放ecmall商城的QQ登陆功能,在回调时产生错误,file_get_contents函数执行时,没有抓取到正确的信息,于是改用curl,但是提示证书错误。

在网上找到了解决方法,就是去掉证书认证。

复制代码 代码如下:


curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

该种方法可行。

网上还有另外一种说法,就是使用

复制代码 代码如下:


curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

但是测试结果是错误的。

非常简单的解决办法,不过解决起来却花了不少的功夫查资料,这里记录下来,分享给大家。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn