For WAMP, this is what finally worked for me.
While it is similar to others, the solutions mentioned on this page, and other locations on the web did not work. Some "minor" detail differed.
Either the location to save the PEM file mattered, but was not specified clearly enough.
Or WHICH php.ini
file to be edited was incorrect. Or both.
I'm running a 2020 installation of WAMP 3.2.0 on a Windows 10 machine.
Link to get the pem file:
http://curl.haxx.se/ca/cacert.pem
Copy the entire page and save it as: cacert.pem
, in the location mentioned below.
Save the PEM file in this location
<wamp install directory>\bin\php\php<version>\extras\ssl
eg saved file and path: "T:\wamp64\bin\php\php7.3.12\extras\ssl\cacert.pem"
*(I had originally saved it elsewhere (and indicated the saved location in the php.ini file, but that did not work).
There might, or might not be, other locations also work. This was the recommended location - I do not know why.)
WHERE
<wamp install directory>
= path to your WAMP installation.
eg: T:\wamp64\
<php version>
of php that WAMP is running: (to find out, goto: WAMP icon tray -> PHP <version number>
if the version number shown is 7.3.12, then the directory would be: php7.3.12)
eg: php7.3.12
Which php.ini file to edit
To open the proper php.ini
file for editing, goto: WAMP icon tray -> PHP -> php.ini
.
eg: T:\wamp64\bin\apache\apache2.4.41\bin\php.ini
NOTE: it is NOT the file in the php directory!
Update:
While it looked like I was editing the file: T:\wamp64\bin\apache\apache2.4.41\bin\php.ini
,
it was actually editing that file's symlink target: T:/wamp64/bin/php/php7.3.12/phpForApache.ini
.
Note that if you follow the above directions, you are NOT editing a php.ini
file directly. You are actually editing a phpForApache.ini
file. (a post with info about symlinks)
If you read the comments at the top of some of the php.ini
files in various WAMP directories, it specifically states to NOT EDIT that particular file.
Make sure that the file you do open for editing does not include this warning.
Installing the extension Link Shell Extension allowed me to see the target of the symlink in the file Properites window, via an added tab. here is an SO answer of mine with more info about this extension.
If you run various versions of php at various times, you may need to save the PEM file in each relevant php directory.
The edits to make in your php.ini file:
Paste the path to your PEM file in the following locations.
uncomment ;curl.cainfo =
and paste in the path to your PEM file.
eg: curl.cainfo = "T:\wamp64\bin\php\php7.3.12\extras\ssl\cacert.pem"
uncomment ;openssl.cafile=
and paste in the path to your PEM file.
eg: openssl.cafile="T:\wamp64\bin\php\php7.3.12\extras\ssl\cacert.pem"
Credits:
While not an official resource, here is a link back to the YouTube video that got the last of the details straightened out for me: https://www.youtube.com/watch?v=Fn1V4yQNgLs.
curl_init()
etc, or are you running curl from the command line. It doesn't really help to change the PHP settings if you're not using PHP cURL, and those two lines at the bottom of the question are settings for PHP cURL. – Ten