install GeoIP (Php) on ubuntu 16.04


I wont to install the GeoIP (Php) on ubuntu 16.04 for the tracking option in piwik to work, But i dont seems to get it right. How can i install this?


It looks like there’s a package for that in the Ubuntu universe repository… try running this command:

apt-get install php-geoip

Yes i have already try that and it dont fix the problem.

The following packages should get you closer:

apt-get install geopip-datbase geoip-database-extra php-geoip

After install, use the following to see the location of the installed DBs:

dpkg -L geoip-database
dpkg -L geoip-database-extras

Note the location of the installed database files (.dat file extensions) in the above package listings. The next step might be to specify the DB location in your web-server config. Assuming you are running nginx --with-http_geoip_module support, you can try to add the following code to your http block under /etc/nginx/sites-enabled/{site_config_file}:


geoip_country /etc/nginx/geoip/GeoIP.dat;
geoip_city /etc/nginx/geoip/GeoIPCity.dat;


Or, if you are using apache instead of nginx, the following package will be required:

apt-get install libapache2-mod-geoip