I posted the same question on StackOverflow, but someone told me that I should ask it here: https://stackoverflow.com/questions/61894424/php-seems-to-ignore-my-curl-info-of-my-php-ini.
I'm using WAMP on Windows with several version of PHP. The one I currently use is PHP 7.3.12. After following carefully every step of installing the cacert.pem file into my WAMP folder, my PHP does not seems to see it. Here's the step I've taken to install it:
- I downloaded the
cacert.pemfile from https://curl.haxx.se/docs/caextract.html - I moved this file into my
extras\sslfolder of my PHP folder (C:\dev\wssp\wamp\bin\php\php7.3.12\extras\ssl\cacert.pem) - I wrote this absolute path into the
php.inifile from WAMP, aftercurl.cainfo(and I removed the;caracter), by left-clicking the WAMP icon>PHP>php.ini. This file is located here:C:\dev\wssp\wamp\bin\apache\apache2.4.41\bin\php.ini. - Then I restart my WAMP services and it literally copy this file on the
php.inifile of the PHP version I'm currently using here:C:\dev\wssp\wamp\bin\php\php7.3.12\phpForApache.ini.
Even after theses steps, PHP do not seems to see my cacert file because when I try to dd(ini_get('curl.cainfo')) if give me this: https://i.stack.imgur.com/FOYAW.png (sorry, can't post image w/o 10 rep)
Just to be sure, I looked into my phpinfo() in the curl section: https://i.stack.imgur.com/g3EQU.png (sorry, can't post image w/o 10 rep)
But when I dumped my php.ini file with this command dd(file_get_contents(php_ini_loaded_file()));, I can clearly see my curl.cainfo path: https://i.stack.imgur.com/5bR1B.png (sorry, can't post image w/o 10 rep)
I'm not sure what I did wrong, but when using GuzzleHTTP from my Laravel projet, I tried giving the library an absolute path $client = new \GuzzleHttp\Client(['verify' => 'C:\dev\wssp\wamp\bin\php\php7.3.12\extras\ssl\cacert.pem']); and it worked. I still want to be able to use it with the php.ini file for environnement purpose.