The Movie Database-ondersteuning

Hello guys,

I am very new to APIs and this was the first time using it. I programmed everything in php and it worked fine for me on localhost on my PC. To have access on the database on my entire network, I wanted to install the database on a linux vserver (Debian 7.0 Wheezy Minimalsystem (64 Bit) I set up Apache, phpmyadmin and stuff and everything works except for the api connection that had worked on localhost. Here is my code, maybe someone knows where the problem is, maybe I have just forgotten to install a package.


<?php
    $ca = curl_init();

curl_setopt($ca, CURLOPT_URL, "http://api.themoviedb.org/3/configuration?api_key=###");
curl_setopt($ca, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ca, CURLOPT_HEADER, FALSE);
curl_setopt($ca, CURLOPT_HTTPHEADER, array("Accept: application/json"));
$response = curl_exec($ca);
curl_close($ca);
$config = json_decode($response, true);


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.themoviedb.org/3/movie/131631?api_key=###&append_to_response=releases&language=de");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);


echo var_dump($result) //returns nothing

?>

1 antwoord (op pagina 1 van 1)

Jump to last post

I solved the issue by myself. It was a package that has missed. For everyone who may have the same problem : The curl package missed, to get it, type: "apt-get install php5-curl"

Have a nice day.

Film of tv-serie niet gevonden? Meld je aan om deze toe te voegen.

Wereldwijd

s focus op zoekbalk
p open profielmenu
esc sluit een open venster
? open sneltoetsen venster

Op media pagina's

b ga terug (of ga naar bovenliggend item)
e ga naar beweken

Op tv-seizoenspagina's

(rechter pijl) ga naar volgende seizoen
(linker pijl) ga naar vorig seizoen

Op pagina's met tv-series

(rechter pijl) ga naar volgende aflevering
(linker pijl) ga naar vorige aflevering

Op alle afbeeldingspagina's

a open venster afbeelding toevoegen

Op alle bewerkte pagina's

t open vertaalmenu
ctrl+ s verstuur formulier

Op discussiepagina's

n start nieuwe discussie
w Verander kijk status
p privé of openbaar
c schakelen sluiten/openen
a open activiteit
r beantwoord discussie
l ga naar laatste antwoord
ctrl+ enter verstuur uw bericht
(rechter pijl) volgende pagina
(linker pijl) vorige pagina

Instellingen

Want to rate or add this item to a list?

Inloggen