use curl_setopt($link, CURLOPT_SSL_VERIFYPEER, FALSE);
to resolve your issue
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.google.com/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($link, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
if (curl_error($ch)) {
$error_msg = curl_error($ch);
var_dump($error_msg);exit;
}
curl_close($ch);
var_dump($response);
Note:- The above can come with security issue, so exactly fix this issue try to run below command in your system:
/bin/chmod 755 /etc/pki/tls/certs
Reference:- How to fix the Curl Error: error setting certificate verify locations
string(107) "error setting certificate verify locations: CAfile: C:\xampp\apache\bin\curl-ca-bundle.crt CApath: none"