file(), fopen() hang

Questions about hostip.info remote GET support.

Moderator: Moderators

file(), fopen() hang

Postby gadger on Mon Jan 30, 2006 1:27 pm

Hi,
All this geo-location stuff seems great and I'd really love to use it but when I try using php to open a stream to the api everything hangs.

Have been banging my head against a brick wall for hours and am starting to pull my hair out. Anyone got any ideas?

The code is quite simple:

$ppp = "http://www.hostip.info/api/get.html?ip=".$ip_address;
$result = file($ppp);

and is actually taken from one of the forum entries although I've tried various alternatives. The thing is, if I change $ppp to point to another location such as a test file on my server, everything works fine. Everything hangs as soon as I change it back to the hostIp url.

Thanks for any help anyone can offer.
gadger
n00b
 
Posts: 2
Joined: Mon Jan 30, 2006 1:17 pm

solution

Postby gadger on Tue Jan 31, 2006 3:03 am

Ok, think I've got it sorted now - please ignore my original request for help.

Turns out its likely to be my hosting provider - whilst I'd checked that allow_url_fopen was "on" I wasn't aware that various domains might be firewalled too. Whilst I haven't remedied this just yet - it seems to be the most likely source of my problems since the scripting side is so straight forward.

Duh. Should have guessed.

Thanks.
gadger
n00b
 
Posts: 2
Joined: Mon Jan 30, 2006 1:17 pm


Return to Hostip.info remote GET/PHP support

Who is online

Users browsing this forum: No registered users and 0 guests

cron