Hi,
I have PECL installed and the geolocation works perfectly for the countries, however, if I include GeoIPCity.dat in piwik/misc folder, when I go to the section of piwik Geolocation only a blank page is shown. If I rename GeoIPCity.dat to GeoIPCity.dat.new or delete the file, the geolocation page is displayed again in the piwik dashboard.
What can be happening?
Thanks for your help.
Best regards,
Francisco R.
Lukas
(Lukas Winkler)
July 11, 2017, 7:22pm
#2
Hi,
The blank page indicates a php error.
Can you check the php error log for errors?
Error log shows the following error:
[proxy_fcgi:error] [pid 16711:tid 140524694484736] [client 1xx.7x.12x.1xx:17591] AH01071: Got error ‘PHP message: PHP Fatal error: Cannot redeclare geoip_country_code_by_addr() in /var/www/vhosts/dominioxx.com/httpdocs/analytics/libs/MaxMindGeoIP/geoip.inc on line 1709\n’, referer: https://www.dominioxx.com/analytics/index.php?module=CoreAdminHome&action=home&idSite=1&period=day&date=yesterday
Thanks for your help.
Best regards,
Francisco R.
Lukas
(Lukas Winkler)
July 11, 2017, 8:09pm
#4
Is it possible you are using an fork of the geoip php extension?
It seems like you are running into the same error as
opened 03:08PM - 26 Feb 16 UTC
closed 11:19AM - 10 May 21 UTC
Bug
not-in-changelog
### Abstract
`/libs/MaxMindGeoIP/geoip.inc` isn't checking whether all function… s that it implements in the `geoip_*` namespace already exist. This can lead to fatal errors in Piwik when a non-default version of `geoip.so` is installed on the server.
### Solution
Every `geoip_*` function defined in this file should be surrounded by a check for existence, like some of them already have them.
```
if (!function_exists('geoip_xxx')) {
...
}
```
### Example
We've recently upgraded our production environment to PHP7, using Ondřej Surý's excellent PPA for PHP7 in Ubuntu. But as the official `geoip` extension hasn't been ported to PHP7 yet, we had to compile some fork that has this support enabled. The best choice seemed to be @Zakays fork (https://github.com/Zakay/geoip) and it worked fine for our needs. This extension also implements some functions in the `geoip_*` namespace that aren't available in the default PHP5 extension, but are defined in the aforementioned `geoip.inc` file, which leads to an error like:
```
PHP Fatal error: Cannot redeclare geoip_country_code_by_addr() in /var/www/piwik/libs/MaxMindGeoIP/geoip.inc
```
and
Hello;
I am having the below error code on my error log.
[Tue Nov 15 20:51:18.885268 2016] [proxy_fcgi:error] [pid 6810:tid 139930495870720] [client 154.120.107.176:44880] AH01071: Got error 'PHP message: PHP Fatal error: Cannot redeclare geoip_country_code_by_addr() in /var/www/vhosts/kraftysprouts.com/analytics.kraftysprouts.com/piwik/libs/MaxMindGeoIP/geoip.inc on line 1709\n', referer: https://analytics.kraftysprouts.com/piwik/index.php?module=CoreAdminHome&action=generalSettings&idSite=1&…
This problem is for over 1 year and has not yet been resolved.