Hi new user here, before sending random requests and making the server self destruct.... well that's the level of luck i have i thought id test php code generated by the try it yourself examples in the api documentation.
the code generation for php generated https://developers.themoviedb.org/3/credits gave the following error:
cURL Error #:SSL certificate problem: unable to get local issuer certificate
The php tested was
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.themoviedb.org/3/credit/%7Bcredit_id%7D?api_key=apikeyremoved",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "{}",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}?>
I am using AMPPS like wamps but imho better to test locally. can anyone offer any pointers to correct this?
Many thanks
NW
Can't find a movie or TV show? Login to create it.
გსურთ შეაფასოთ ან დაამატოთ ეს ელემენტი სიაში?
არა წევრი?
Reply by Travis Bell
on ნოემბერი 10, 2016 at 3:38 PM
If I was to guess, it's the issue that is mentioned down the page a bit, here (this link should take you to the answer I'm referencing). I think you need to update the local certificates that cURL is using. If you don't want to to do this the only option is to tell cURL to not verify the host. Which I think is this command:
I'm not clear if you also need this line (maybe?):
But, having said all of this, if you're not interested in validating SSL, you might as well just use http instead in which case none of this applies and just update the URL.