I tried this tutorial http://tech.cibul.net/install-maxminds-geoip-ip-database-on-ubuntu-for-php/ and did everything from it. Compiled the geoip module and also the php extension on my Ubuntu 11.10 installation.
I also tried this more simpler terminal command
(sudo) apt-get install php5-geoip
And it showed successful installation but when I try
geoip_record_by_name('127.0.0.1')
and it still gives nothing, i.e. no array at all.