0

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.pem file from https://curl.haxx.se/docs/caextract.html
  • I moved this file into my extras\ssl folder 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.ini file from WAMP, after curl.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.ini file 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.

  • Hi, thanks for the clear question, but I'am not sure it's a good fit as WAMP stack is considered dev. Sadly you seem on a gray zone between us and SO. See that for the reason of my comment; https://serverfault.com/questions/453617/why-not-use-a-wamp-stack – yagmoth555 May 19 '20 at 16:23
  • A tip, If it's apache and a cert for it, maybe focus your question on how to install the certificate on apache might help or search on that topic, SF is loaded with question about that – yagmoth555 May 19 '20 at 16:24
  • Hello and thank you for your honest answer. I read your comment and I can understand why this is confusing. I might try to reformulate my question on StackOverflow so that a dev can help me. – Alexandre Sauvé May 19 '20 at 16:51

0 Answers0