Fopen wrappers désactivés par mon hébergeur
Nymphomaniaque
Messages postés
63
Statut
Membre
-
Nymphomaniaque Messages postés 63 Statut Membre -
Nymphomaniaque Messages postés 63 Statut Membre -
Bonjour,
J'ai sur une page php ce bout de code qui ne marche pas
J'ai écrit à mon hébergeur. Celui-ci m'informe que :
file_get_contents is enabled, however fopen wrappers are disabled on hosting so you will not be able to do a remote get.
cURL is enabled on free hosting but can only access port 80.
Je ne sais pas comment je peux faire pour remédier au problème tout en restant dans l'hébergement gratuit ?
J'ai sur une page php ce bout de code qui ne marche pas
$stringIp = $_SERVER['REMOTE_ADDR'];
$xml = file_get_contents('http://api.hostip.info/?ip='.$stringIp);
J'ai écrit à mon hébergeur. Celui-ci m'informe que :
file_get_contents is enabled, however fopen wrappers are disabled on hosting so you will not be able to do a remote get.
cURL is enabled on free hosting but can only access port 80.
Je ne sais pas comment je peux faire pour remédier au problème tout en restant dans l'hébergement gratuit ?
A voir également:
- Fopen wrappers désactivés par mon hébergeur
- Récupérer mon compte facebook désactivé - Guide
- Comptes desactivés instagram - Guide
- Les widgets sont désactivés en mode sécurisé - Guide
- Mon pavé tactile est désactivé - Guide
- Les raccourcis clavier sont désactivés discord - Forum InDesign
2 réponses
oui, j'ai essayé comme ceci :
d'abord j'ai défini la fonction
Puis, je lui ai fait appel :
d'abord j'ai défini la fonction
function http_fetch_url($url, $timeout = 10)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
Puis, je lui ai fait appel :
$stringIp = $_SERVER['REMOTE_ADDR'];
$fch=sprintf('http://api.hostip.info/?ip=%s',$stringIp);
$xml=http_fetch_url($fch,10);