Home>Article>Backend Development> How to solve php curl 56 error

How to solve php curl 56 error

Joseph Gordon-Levitt
Joseph Gordon-Levitt Original
2021-07-09 09:43:44 5067browse

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协议的网站的时候,可能会获得上面的错误

Analysis

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

Solution

curl provides options to bypass ssl

curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);

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!

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