The Movie Database Support Forum

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 Antwort (Seite 1 von 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.

Es fehlt ein Film oder eine Serie? Logge dich ein zum Ergänzen.

Allgemein

s Fokus auf Suchfeld
p Profil öffnen
esc Fenster schließen
? Tastenkürzel anzeigen

Videos

b Zurück
e Bearbeiten

Staffeln

Nächste Staffel
Vorherige Staffel

Episoden

Nächste Episode
Vorherige Episode

Bilder

a Poster oder Hintergrundbild hinzufügen

Editieren

t Sprachauswahl öffnen
ctrl+ s Speichern

Diskussionen

n Neue Diskussion erstellen
w Beobachten an / aus
p Diskussion öffentlich / privat
c Diskussion öffnen / schließen
a Diskussionsverlauf anzeigen
r Auf Diskussion antworten
l Letzte Antwort anzeigen
ctrl+ enter Senden
Nächste Seite
Vorherige Seite

Einstellungen

Diesen Eintrag bewerten oder zu einer Liste hinzufügen?

Anmelden