Install GeoIP On Wamp
Posted by: TheKillerR (---.rdsnet.ro)
Date: November 28, 2010 07:51AM

Hello

i find out about this PHP Extension months ago but i didnt made to install it

Can anyone please give me the steps on what to download etc

i understood i need the db and a php_geoip.dll but its nowhere on the PHP Site
found it on some other site months ago and it had some error when i activated it


[php.net]

Options: ReplyQuote
Re: Install GeoIP On Wamp
Posted by: TheKillerR (---.rdsnet.ro)
Date: November 29, 2010 04:53PM

Anyone.....?

Options: ReplyQuote
Re: Install GeoIP On Wamp
Posted by: bondies (---.dyn.iinet.net.au)
Date: November 30, 2010 05:15AM

Maxmind make several different Geolocation products the Free / Open Source versions include GeoLite Country & GeoLite City (http://www.maxmind.com/app/geolitecity)

Looks like for Apache you also need Mod_GeoIP & the GeoIP C Library. (http://www.maxmind.com/app/mod_geoip)

There is also a straight PHP mod (http://www.maxmind.com/app/php)

The setup is a bit beyond the scope of this forum, but there are plenty of sites out there that will list all the steps (this one is from [www.sequentiallogic.com]) but basically if you are happy with the lighter pure php version just download the php files geoipcity.inc, geoip.inc, and geoipregionvars.php then download a copy of the binary format file put all these files in a web accessible directory and then make a php file containing this

<?php
require_once('/PATH/TO/GeoIP/geoipcity.inc');
$gi = geoip_open('/PATH/TO/GeoIP/GeoLiteCity.dat', GEOIP_STANDARD);
$location = GeoIP_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);
echo '<pre>';
print_r($location);
echo '</pre>';
?>
I believe you are in <?php echo $location->city ?>, <?php echo $location->region ?>

Options: ReplyQuote
Re: Install GeoIP On Wamp
Posted by: MtR (182.180.190.---)
Date: June 10, 2015 12:23PM

i proceed through the same procedure but i'm getting null values in location, city and region.

Options: ReplyQuote


Sorry, only registered users may post in this forum.