php中出现的cURL error 60: SSL certificate problem: unable to get local issuer certificate

In the process of using laravel, there is always an error when calling an interface. dd sees this error. cURL error 60: SSL certificate problem: unable to get local issuer certificateBy default, cURL is not trusted by any CAS. There is a problem with the CA certificate. Here are the steps to solve it:

1. Download cacert.pem

Enter the official website and download the latest version (the external network may load slowly)
insert image description here

2. Put it in extras/ssl under the php file

insert image description here

3. Configure php.ini

Configure the path of curl.cainfo and openssl.cafile as the download location of the above pem file, pay attention to ;remove the comment, otherwise it will not take effect
insert image description here

4. If the php service is enabled, the server needs to be restarted to take effect

Guess you like

Origin blog.csdn.net/skybulex/article/details/123566230