PHP: Resolving "SSL certificate error: unable to get local issuer certificate"
When utilizing the Mandrill API and encountering the error "API call to messages/send-template failed: SSL certificate problem: unable to get local issuer certificate," despite configuring curl.cainfo in php.ini as suggested on StackOverflow, it's crucial to consider these comprehensive steps:
-
Acquire the Certificate Bundle: Download the certificate bundle from a reliable source such as curl.haxx.se (docs/caextract.html).
-
Placement of Certificate: Place the cacert.pem file in a convenient location, such as the directory where XAMPP is installed. For instance, in c:xampp or c:xampp64 (if using Wamp 64 bit).
-
mod_ssl and php_openssl.dll Configuration: Ensure that mod_ssl is enabled in Apache and php_openssl.dll is uncommented in the php.ini file(s). Note that there may be multiple php.ini files, so it's essential to configure both of them.
-
Update php.ini: Modify both php.ini files to include the following lines:
curl.cainfo="C:/xampp/cacert.pem"
openssl.cafile="C:/xampp/cacert.pem"
Copy after login
-
Restart Server Services: Reinstate the Wamp or XAMPP services for the changes to take effect.
The above is the detailed content of How to Fix 'SSL certificate error: unable to get local issuer certificate' in PHP's Mandrill API?. For more information, please follow other related articles on the PHP Chinese website!