The documentation under http://piwik.org/faq/how-to/#faq_163 suggests to run the following command on Debian or Ubuntu machines to set up the GeoIP PECL extension for PHP:
sudo apt-get install php5-geoip php5-dev libgeoip-dev
I don't see why there should be an need to install php5-dev and libgeoip-dev if you don't want to compile the PECL extension yourself. And actually there is no need to compile that extension yourself under Debian or Ubuntu, because it is available from the main repository.
So to set up GeoIP PECL under Debian or Ubuntu, the following should be sufficient:
sudo apt-get install geoip-database-contrib php5-geoip
This installs a package which downloads all databases and even configures a cronjob for the user to update these databases every month, if the user whishes to do so.
Looks good to me, maybe someone else knows why those dependencies are listed there?
Thanks for the report, maybe @diosmosis you have some feedback
I can't remember much from back then.
Note: If you change the FAQ to use geoip-database-contrib it should mention if it's possible to use the package w/ commercial MaxMind DBs and if not to mention Piwik's auto updater.
we should test it before changing the doc, if someone is keen please go ahead
Would be nice to get this uptodate. Also note that PHP7 is spreading fast, so an explicit referral to php5 is not useful. I would also like to see a clearer distinction between 'compile' and simply install. Use some extra header?
@mvhconsult Unfortunately we don't have time or resource right now, but if you can help we'd love to see a pull request :+1:
The suggested change above got GeoIP PECL working correctly for me on PHP 7/ Ubuntu 16.04. I also set
php.ini to use the database that is updated via cron. The documented PECL install command (with php5 changed to php) only provided country level locations even though the UI reported everything was fine.
As Matomo now uses GeoIP2 this can be closed. The C extension isn't needed anymore and if one still wants to use it, it is explained here: