Home > Backend Development > PHP Tutorial > How to Fix 'SSL certificate error: unable to get local issuer certificate' in PHP's Mandrill API?

How to Fix 'SSL certificate error: unable to get local issuer certificate' in PHP's Mandrill API?

DDD
Release: 2024-12-19 01:35:10
Original
492 people have browsed it

How to Fix

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:

  1. Acquire the Certificate Bundle: Download the certificate bundle from a reliable source such as curl.haxx.se (docs/caextract.html).
  2. 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).
  3. 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.
  4. 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
  1. 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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template