PHP cURL Error

  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • PHP cURL Error


    I am facing an issue with cURL in my PHP application. When trying to make a secure HTTPS request, I am getting the following error:

    cURL error: SSL certificate problem: unable to get local issuer certificate

    • Server Environment: Apache on Ubuntu 20.04
    • PHP Version: 7.4
    • cURL Version: 7.68.0

    Code Snippet

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $response = curl_exec($ch);
    if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);

    I haveverified that the SSL certificate is valid and not expired. Downloaded and updated the cacert.pem file from cURL's website and configured php.ini:

    curl.cainfo = "/path/to/cacert.pem"

    Checked the server's openssl version and it is up-to-date.

    How can I resolve the "unable to get local issuer certificate" error in cURL?
    Are there any additional configurations I need to make in php.ini or my server environment?

    Any suggestions on how to solve this SSL issue would be greatly appreciated.

    Thank you in advance for your help!

    Best regards,

    msbi course