The above solutions are great, but if you're using WampServer you might find setting the curl.cainfo
variable in php.ini
doesn't work.
I eventually found WampServer has two php.ini
files:
C:\wamp\bin\apache\Apachex.x.x\bin
C:\wamp\bin\php\phpx.x.xx
The first is apparently used for when PHP files are invoked through a web browser, while the second is used when a command is invoked through the command line or shell_exec()
.
TL;DR
If using WampServer, you must add the curl.cainfo
line to both php.ini
files.