cURL error 60: SSL certificate problem: unable to get local issuer certificate
This problem can occur when developing locally on windows. I am using windows 10 (x64)
In order to fix the error, I downloaded cacert.pem from https://curl.haxx.se/docs/caextract.html
Set the following value for in php.ini
curl.cainfo = "C: \ php-8.0.7 \ extras \ ssl \ cacert.pem"
PHP.mk документација
Конфигурација во време на извршување
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Патека
curl.configuration.php
Локална патека за оваа страница.
Извор
php.net/manual/en
Оригиналниот HTML се реупотребува и локално се стилизира.
Режим
Прокси + превод во позадина
Кодовите, табелите и белешките остануваат читливи во истиот тек.
Референца
curl.configuration.php
Конфигурација во време на извршување
Референца за `curl.configuration.php` со подобрена типографија и навигација.
Конфигурација во време на извршување
Поведението на овие функции е под влијание на поставките во php.ini.
| Име | Стандардно | Променливо | Дневник на промени |
|---|---|---|---|
| curl.cainfo | NULL | INI_SYSTEM |
Еве кратко објаснување на директивите за конфигурација.
-
curl.cainfostring -
Стандардна вредност за
CURLOPT_CAINFOопцијата. Ова мора да биде апсолутна патека.
Белешки од корисници 3 белешки
knuklus at gmail dot com ¶
пред 4 години
ajith at pavanathara dot com ¶
пред 5 години
cURL error 60: SSL certificate problem: unable to get local issuer certificate
This local development error comes when curl.cainfo variable is not set correctly.
I faced this issue in PHP Version 7.3.1
In order to fix the error, I downloaded cacert.pem from https://curl.haxx.se/docs/caextract.html
Set the following paths in php.ini
curl.cainfo="D:\wamp64\bin\php\php7.3.1\extras\ssl\cacert.pem"
openssl.cafile="D:\wamp64\bin\php\php7.3.1\extras\ssl\cacert.pem"
Even after adding the paths and restart Apache, Inside phpinfo(), both the paths were showing blank.
The error will go only if we set via php code of the project.
Example code worked for me :-
$guzzle = new \GuzzleHttp\Client(['verify' => 'D:\wamp64\bin\php\php7.3.1\extras\ssl\cacert.pem']);
ajith at pavanathara dot com ¶
пред 5 години
I was editing wrong php.ini file in last comment.
Even though loaded configuration path was showing as "D:\wamp64\bin\apache\apache2.4.37\bin\php.ini" inside phpinfo() of WAMP Server, It was actually loading "D:\wamp64\bin\apache\apache2.4.37\bin\phpForApache.ini"
Once I set both the variables inside phpForApache.ini, details are displayed in phpinfo() and error has gone without extra coding line.