How to solve php curl 56 error

藏色散人
Release: 2023-03-11 11:36:01
Original
5043 people have browsed it

The solution to the php curl 56 error is to set "curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);".

How to solve php curl 56 error

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

How to solve the php curl 56 error?

php curl access https site curl: (56) Recv failure: Connection was reset problem

Scenario

curl访问https协议的网站的时候,可能会获得上面的错误
Copy after login

Analysis

https协议是 ssl协议和http协议的组合,访问这类网站 需要检查ssl证书, 证书验证失败,没有访问权限
Copy after login

Solution

curl provides options to bypass ssl

curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);
Copy after login

Recommended study: "PHP Video Tutorial

The above is the detailed content of How to solve php curl 56 error. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!