Page 1 of 1

file(), fopen() hang

PostPosted: Mon Jan 30, 2006 1:27 pm
by gadger
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 = "".$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.


PostPosted: Tue Jan 31, 2006 3:03 am
by gadger
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.