I am trying to use the Mailchimp API Wrapper which they provide. It uses the PHP Curl extension and on my development environment (PHP, Apache and Ubuntu) everything worked fine.
Now I am trying to get it to work on the live environment which is PHP 5.6.7 on IIS 7.5. phpinfo tells me that I'm using CURL 7.40.0. Whatever I do I keep getting the same error SSL certificate problem: unable to get local issuer certificate
I have had a look around lots of similar questions to try to find the answer. A common theme is to download the CA Bundle (I've tried both the HTTP from curl.haxx.se and the HTTPS from github versions) and then either modify the code to include
curl_setopt($ch, CURLOPT_CAINFO, "C:\path\to\cacert.pem");
or my preferred option which is to add to the php.ini file
curl.cainfo="C:\path\to\cacert.pem"
but neither of those have fixed the problem. I have also tried the
ini_set('openssl.cafile', '\path\to\cacert');
as suggested here, and this also doesn't work.
I'm wondering if the problem could be file permissions (so I've been giving everybody read access to cacert.pem to eliminate that possibility), or if the problem has something to do with needing to escape the \ characters in PHP (so I've tried both the c:\path\to\cacert.pem and c:\path\to\cacert.pem varieties) but regardless of what I do I haven't found any combinations that will make it work, except for setting CURLOPT_SSL_VERIFYPEER
to false
which I obviously don't want to do.
I'm wondering if this is the same problem as in this question, the main difference being that I'm using IIS and not XAMPP.
Is there anything I'm missing - any reason why this setup won't work?
Thanks in advance for any suggestions.