How do I know if GEOIP is working? I have two servers, one on ubuntu and the other hosted at greengeeks.

Both are configured to use the location module and views to do a proximity search using geoip to get the visitors location. The local server on ubuntu (on my laptop) shows me the results within the specified range. The one at greengeeks does not return results, even when I up the radius to 1000 miles. Both appears to be configured identically, as far as I can tell.

Is there something server specific needed? Is there a way to test the geoip module (code on a page or something) so I can either eliminate geoip as the cause or tell if it is the cause and I am missing something?

Thanks in advance,
Julie

Comments

spyderpie’s picture

Status: Active » Closed (fixed)

Never mind .. found this code on another post:

$c = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$_SERVER['REMOTE_ADDR']));
$visitorCity = $c["geoplugin_city"] ;
$visitorState = $c["geoplugin_region"];
//print_r ($c); this prints out all keys in array for reference
print ("$visitorCity, ");
print ($visitorState);

This gave me what I needed.

Julie

pitxels’s picture

Status: Closed (fixed) » Active

Indeed, How do I tell if GEOIP is working? How to troubleshoot this?

liminu’s picture

I try to use this code but no receive output.
The .dat is correctly download and in the correct place, so what can i do?
I delete cache and similar.

bojanz’s picture

Issue summary: View changes
Status: Active » Closed (outdated)