Enabling GeoIP (PECL) via configuration


#1

I’ve created a private Piwik RPM that includes my DB configuration and automatically gets installed on a new instance. As a part of the init script of each instance, the GeoIP PECL extension is also installed.
When I log into Piwik for the first time, GeoIP/PECL is marked as installed and available, but not as selected.
I don’t see anything in config/config.ini.php (before or after manually selecting GeoIP/PECL) that would suggest GeoIP/PECL is enabled.

Is there any way to make GeoIP/PECL the default via configuration files?


(Matthieu Aubry) #2

Is there any way to make GeoIP/PECL the default via configuration files?

Yes there is, unfortunately it’s not as simple as it should be :frowning: you need to create a PHP script that loads Piwik files using this technique: Querying the Reporting API: Integrate - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

then write the following code:


LocationProvider::setCurrentProvider(LocationProvider\GeoIp\Pecl::ID);

if you want an APi for this, please create feature request: Issues · matomo-org/piwik · GitHub