I am working on a project with Symfony 6, PHP 8 and trying to upload images to Cloudinary using its PHP SDK, cloudinary/cloudinary_php
version 2.7.1 and following these docs.
I am creating a Cloudinary instance as
$cloudinary = new Cloudinary([
'cloud' => [
'cloud_name' => 'my_name',
'api_key' => 'my_api_key',
'api_secret' => 'my_api_secret']
]);
and then uploading my base64 file as
$result = $cloudinary->uploadApi()->upload($base64Image);
Doing this I get the following GuzzleHttp\\Exception\\RequestException
:
cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.cloudinary.com/v1_1/oralec/image/upload
What I tried
I ended up in this question (and others of the same nature) where the accepted answer is always to download cacert.pem from https://curl.se/docs/caextract.html and the set your modify your php.ini file with
curl.cainfo = <absolute_path_to> cacert.pem
which in my case is
curl.cainfo = "C:\php\cacert.pem"
But this makes no difference in the exception I get. I tried modifying php.ini, php.ini-development and php.ini-production, just in case.
I also tried installing vendors like https://github.com/composer/ca-bundle
and https://github.com/paragonie/certainty
, again with no success at all.
Any help is appreciated!