PHP - SSL certificate error: unable to get local issuer certificate

前端 未结 16 2723
时光取名叫无心
时光取名叫无心 2020-11-21 07:49

I\'m running PHP Version 5.6.3 as part of XAMPP on Windows 7.

When I try to use the Mandrill API, I\'m getting the following error:

Uncaught e

16条回答
  •  无人共我
    2020-11-21 08:08

    If you don't have access to php.ini, adding this code (after your $ch = curl_init(); line) works for me:

    $certificate_location = "C:\Program Files (x86)\EasyPHP-Devserver-16.1\ca-bundle.crt"; // modify this line accordingly (may need to be absolute)
    curl_setopt($ch, CURLOPT_CAINFO, $certificate_location);
    curl_setopt($ch, CURLOPT_CAPATH, $certificate_location);
    

    Then, you will just need to download ca-bundle.crt and save it to location you specified in $certificate_location.

提交回复
热议问题