Home  >  Article  >  Backend Development  >  How to Resolve PHP cURL Error Code 60: SSL Certificate Problem

How to Resolve PHP cURL Error Code 60: SSL Certificate Problem

Susan Sarandon
Susan SarandonOriginal
2024-10-24 22:38:02493browse

How to Resolve PHP cURL Error Code 60: SSL Certificate Problem

PHP cURL Error Code 60: Resolving SSL Certificate Issue

When utilizing cURL in PHP with Windows environments, the "SSL certificate problem" error (cURL error code 60) can arise. This indicates an inability to retrieve the issuing certificate locally.

To resolve this issue, ensure that the following steps have been taken:

  1. Add the cainfo setting to PHP.ini:

    • In your PHP.ini file, add the following line:

      curl.cainfo = C:\Windows\ca-bundle.crt
    • Replace "C:Windowsca-bundle.crt" with the actual path to the trusted certificate (e.g., cacert.pem).
  2. Restart web server:

    • Once the cainfo setting is added, restart your web server (e.g., WAMP) to ensure the changes take effect.
  3. Use a reliable certificate:

    • The certificate you are using may not be reliable. Obtain the root certificate bundle from the link below and copy it to your disk:
    • https://curl.haxx.se/ca/cacert.pem
  4. Update cainfo setting:

    • In your PHP.ini file, update the cainfo setting to point to the downloaded certificate bundle:

      curl.cainfo = "path_to_cert\cacert.pem"

By following these steps, you can ensure that cURL has access to a trusted certificate, resolving the error and allowing you to successfully execute the Amazon PHP SDK.

The above is the detailed content of How to Resolve PHP cURL Error Code 60: SSL Certificate Problem. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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