@driehle opened this Issue on January 20th 2015

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.

@tsteur commented on January 20th 2015 Member

Looks good to me, maybe someone else knows why those dependencies are listed there?

@mattab commented on February 7th 2015 Member

Thanks for the report, maybe @diosmosis you have some feedback

@diosmosis commented on February 7th 2015 Member

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.

@mattab commented on February 9th 2015 Member

we should test it before changing the doc, if someone is keen please go ahead

@mvhconsult commented on December 1st 2016

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?

@mattab commented on December 1st 2016 Member

@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:

@benwazza commented on January 31st 2017

The suggested change above got GeoIP PECL working correctly for me on PHP 7/ Ubuntu 16.04. I also set geoip.custom_directory=/usr/share/GeoIPin 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.

@Findus23 commented on December 27th 2018 Member

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:

This Issue was closed on December 27th 2018
Powered by GitHub Issue Mirror