Home>Article>Backend Development> What to do if php curl returns error code 60
Solution to the error code 60 returned by php curl: 1. Curl turns off certificate verification; 2. Reference the cacert.pem file in the php.ini configuration file of php.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
What to do if php curl returns error code 60 ?
php curl error 60 error solution:
Today a user encountered the following error when calling a curl method. I searched for some information. Finally solved. Record the solution and keep it for yourself to refer to later.
Error code
cURL error 60: SSL certificate problem: unable to get local issuer certificate
After customizing the takeover error output, it may be displayed as follows
cURL error 60 错误 curl code ERROR 60错误
Cause of error:
curl is being configured Turning on certificate verification
means using the following configuration
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
Solution:
Method 1:
curl Close the certificate Verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
Method 2:
Use cacert.pem
Reference this file in the php.ini configuration file of php
Example, code:
curl.cainfo = "D:\php\cacert.pem"
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What to do if php curl returns error code 60. For more information, please follow other related articles on the PHP Chinese website!