Axuda de The Movie Database

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 resposta (na páxina 1 de 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.

Non podes atopar unha película ou serie? Inicia sesión para creala.

Global

s amosar a barra de procura
p abrir menú do perfil
esc pechar e abrir xanela
? abrir xanela de atallos do teclado

En páxinas de medios

b atrás (ou á principal se aplica)
e ir a editar páxina

En páxinas de tempadas de televisión

(flecha dereita) ir á tempada seguinte
(flecha esquerda) ir á tempada anterior

En páxinas de episodios de televisión

(flecha dereita) ir ao episodio seguinte
(flecha esquerda) ir ao episodio anterior

En todas as páxinas de imaxe

a abrir a xanela de engadir imaxe

En todas as páxinas de edición

t abrir selector de traducións
ctrl+ s enviar formulario

Nas páxinas de debate

n crear un novo debate
w amosar o estado do seguimento
p mudar público/privado
c mudar abrir/pechar
a abrir actividade
r responder no debate
l ir á última resposta
ctrl+ enter eviar a túa mensaxe
(flecha dereita) páxina seguinte
(flecha esquerda) ir á páxina anterior

Configuración

Queres valorar ou engadir o elemento a unha listaxe?

Iniciar sesión