Maxmind PHP Geoip

Maxmind PHP Geoip

I searched the forums but didn’t find anything much in regard to a custom php install of Maxmind’s PHP geoip. I would like to install this on my Debian 6.0 64bit VPS running DirectAdmin. I want to set it up so that PHP code can call geoip information something like this:

PHP Code:


print_r(geoip_record_by_name('php.net')); 




I tried installing by doing the following:

Code:

# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# gunzip GeoLiteCity.dat.gz
# mkdir -v /usr/share/GeoIP
# mv -v GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat

# apt-get install php5-geoip


But when I put the follow code in a file

PHP Code:


print_r(geoip_record_by_name('php.net')); 




I get the following error message:

PHP Code:


Fatal errorCall to undefined function geoip_record_by_name() 




Please let me know what I’m missing in order to make this work.

Comments are closed.