Professional Documents
Culture Documents
WWW PHP Net Manual en Ref Geoip PHP
WWW PHP Net Manual en Ref Geoip PHP
GeoIP Functions
Table of Contents
I couldn't get it to work with the DMA code database (product ID 137). It
seems to only work with the country database. The documentation should
contain a warning that this code (as of 0.2.0) is incomplete and that
Net_GeoIP should be used for non-country databases.
1 judas dot iscariote at gmail dot com 15 years ago
http://repos.opensuse.org/server:/php:/extensions/
Both, Ubuntu and Debian itself make usage of version 1.3.x of the c
libraries, so installation can't be done with the debian packages, because
configure stops with:
The GeoLiteCity free db works and can resolve city names and other
informations.
http://www.maxmind.com/app/installation?city=1
If you are a Debian or Ubuntu user, instead of building it from source, you
can:
aptitude install libgeoip-dev libgeoip1
-2 nospam dot guilhem at nospam dot answeb dot net 11 years ago
Hello,
While trying to update the GeoIP.dat file under debian, I've found out that
automatic updates via the geoipupdate (in geoip-bin package) is not
available for the free edition. Here is a one-liner script that will do it.
You can put it in a crontab, it will download the .dat file only if it has
change :
function getContinentFromCountry($country)
{
$data = array ("AF"=> "AS","AX"=>"EU","AL"=>"EU", "DZ"=>"AF","AS"=>"OC",
"AD"=>"EU","AO"=> "AF" ........);
return $data[$country];
}
unfortunately this comment's size is restricted, so you will have the rest
by yourself
for example:
getContinentFromCountry("DE") will result in "EU"
-6 php dot comment dot addition at gmail dot com 15 years ago
Just to clarify the other comments, the maxmind post seems to be out of date
/ incorrect.
This module fails to work (ie: resolve cities) with the GeoLite City
database from here:
http://www.maxmind.com/app/geolitecity
GEO-106FREE 20070601 Build 1 Copyright (c) 2007 MaxMind LLC All Rights
Reserved
+add a note
GeoIP
Introduction
Installing/Configuring
Predefined Constants
» GeoIP Functions
Copyright © 2001-2022 The PHP Group My PHP.net Contact Other PHP.net sites