[PHP 4.4.1] probleme pour lire un fichier distant avec CURL
Bonjour,
J'essaie d'importer un flux rss d'un autre serveur. Pour cela, j'utilise la bibliothèque curl. J'ai crée une fonction qui marche correctement sur mon propre PC (PHP5.2). Par contre, dés que je copie la fonction sur le serveur (PHP4.4), celle-ci me retourne un argument vide.
Le problème c'est que je ne sais même pas comment identifier le problème.
Merci.
PS: L'informaticien m'a déjà passé l'option "allow_url_fopen" à ON.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
<?php
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the brow
ser.
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
echo file_get_contents_curl("http://www.emsc-csem.org/rss.php");
?> |