Hello there,
I'm sending a request with Guzzle to an API and it works.
The problem is: the very same request, done from an artisan command, does not work. The error, classic:
cURL error 60: SSL certificate problem: unable to get local issuer certificate for https://api. . . . .
So,
Everything is alright in my php.ini;
I'm already using the cacert.pem file;
I'm using Wamp;
The request does not work only runned with artisan.
What could be the difference in running it in the console to get this error?
I assume that everything is ok with the php.ini because first I ran into that error but with the request from a controller. Then, I set up the cacert.pem file and the curl.cainfo and openssl.cafile with the path. That way, it worked. But when I did the same request from a file from App\Console\Commands, with artisan, the error appeared again.
@camilo okay, but then it depends from which terminal you are trying to run the command. Because the php installed within your WAMP is different to the one you have installed on your computer. So you might need to do a check if you've edited the correct php.ini file. So in your console you can run php --ini it will give you Loaded Configuration File and that's the path for the ini that is missing the certificate.
@Nakov That was it, thanks. FIrst I had manually searched for the "C:\wamp64\bin\php\php7.4.26\php.ini" to make the changes, but using the Wamp menu and accessing PHP > php.ini I ended up in another file: "C:\wamp64\bin\apache\apache2.4.51\bin\php.ini".