"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > How to Resolve PHP cURL Error Code 60: SSL Certificate Problem

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

Published on 2024-11-03
Browse:473

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:\Windows\ca-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.

Release Statement This article is reprinted at: 1729742298 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3