The Movie Database Support

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

1 reply (on page 1 of 1)

Jump to last post

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:

curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);

I'm not clear if you also need this line (maybe?):

curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);

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.

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login