PayPal IPN: unable to get local issuer certificate
You're telling cURL to validate the SSL connection but you're not telling it what to validate against;
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
Make sure you point to an up-to-date list of CA's to trust by adding:
curl_setopt($ch, CURLOPT_CAPATH, "./cacert.pem");
If you don't have an up-to-date cacert list yourself, I'd recommend downloading the one supplied by the cURL maintainer: cacert.pem.