PHP执行Curl时报错提示CURL ERROR: Recv failure: Connection reset by peer
2014-06-26 14:29
981 查看
最近在使用curl中遇到CURL ERROR: Recv failure: Connection reset by peer的报错提示,现把解决方法与大家共享,希望对大家有所帮助。
效果可以看下具体51搜索展示http://www.51bt.cc,结合Xunsearch全文检索技术,可以达到毫秒级的数据搜索
我们经常用curl来访问web站点,web站点目前主要分为http和https两种协议,众所周知https类型的网站都是通过ssl协议+http协议的,是目前最安全的网站协议,访问此类网站的时候,会走ssl协议,验证访问者的证书,检测是否安全。
通过curl访问此类网站也是如此流程,但是curl中需要添加相应的参数,绕过ssl证书的验证,才可以正常访问,如出现此错误的一般原因是没有加此参数(如下所示)。
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);
效果可以看下具体51搜索展示http://www.51bt.cc,结合Xunsearch全文检索技术,可以达到毫秒级的数据搜索
我们经常用curl来访问web站点,web站点目前主要分为http和https两种协议,众所周知https类型的网站都是通过ssl协议+http协议的,是目前最安全的网站协议,访问此类网站的时候,会走ssl协议,验证访问者的证书,检测是否安全。
通过curl访问此类网站也是如此流程,但是curl中需要添加相应的参数,绕过ssl证书的验证,才可以正常访问,如出现此错误的一般原因是没有加此参数(如下所示)。
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);
相关文章推荐
- PHP执行Curl时报错提示CURL ERROR: Recv failure: Connection reset by peer的解决方法
- PHP执行Curl时报错提示CURL ERROR: Recv failure: Connection reset by peer的解决方法
- PHP执行Curl时报错提示CURL ERROR: Recv failure: Connection reset by peer
- PHP执行Curl时报错提示CURL ERROR: Recv failure: Connection reset by peer
- 文件上传时报Recv failure: Connection reset by peer异常解决
- CentOS7: How to resolve curl#56 - "Recv failure: Connection reset by peer"
- CentOS7 yum的一次报错" 14: curl#56 - "Recv failure: Connection reset by peer" "
- curl ip报错curl: (56) Recv failure: Connection reset by peer
- CentOS7: How to resolve curl#56 - "Recv failure: Connection reset by peer"
- curl: (56) Recv failure: Connection reset by peer
- CentOS7: How to resolve curl#56 - "Recv failure: Connection reset by peer"
- 本地clone GitHub上的项目报错 Recv failure: Connection reset by peer
- php502问题解决:recv() failed (104: Connection reset by peer) while reading response header from upstream
- nginx [error] 15644#0: *112680 recv() failed (104: Connection reset by peer) while reading response
- Connection reset,Connection reset by peer,Software caused connection abort :socket write error,recv failed
- 登录ssh提示:ssh_exchange_identification: read: Connection reset by peer error
- excel Connection reset by peer: socket write error错误原因之一
- socket在read时提示【Connection reset by peer】错误
- Connection reset by peer -> Linux 下的错误 error.h
- excel Connection reset by peer: socket write error错误原因之一