Home > Backend Development > PHP Tutorial > How to Fix the PHP SSL Certificate Error: 'unable to get local issuer certificate'?

How to Fix the PHP SSL Certificate Error: 'unable to get local issuer certificate'?

DDD
Release: 2024-12-24 12:26:14
Original
835 people have browsed it

How to Fix the PHP SSL Certificate Error:

PHP SSL Certificate Error: Unable to Retrieve Local Issuer Certificate

When working with PHP on Windows systems, you may encounter the following error: "SSL certificate problem: unable to get local issuer certificate." This issue arises from difficulties in retrieving the certificate bundle needed for successful SSL connections.

To resolve this error, follow these comprehensive steps:

  1. Acquire the Certificate Bundle: Download the certificate bundle from a reliable source, such as http://curl.haxx.se/docs/caextract.html, and save it to an accessible location on your system (e.g., "C:wampcacert.pem").
  2. Enable Necessary Modules: Ensure both the "mod_ssl" in Apache and "php_openssl.dll" in the php.ini file are enabled. Remember to do this for all relevant php.ini files.
  3. Update php.ini Settings: Append the following lines to both php.ini files:
curl.cainfo="C:/wamp/cacert.pem"
openssl.cafile="C:/wamp/cacert.pem"
Copy after login
  1. Restart Services: Restart the web services (e.g., Apache and MySQL) to implement the changes.

After implementing these steps, the SSL certificate error should be resolved, allowing you to establish secure connections.

The above is the detailed content of How to Fix the PHP SSL Certificate Error: 'unable to get local issuer certificate'?. 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