Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Cannot redeclare class Piwik\\Plugins\\GeoIp2\\GeoIp2 in /var/www/piwik/plugins/GeoIp2/GeoIp2.php on line 0 #12846

Closed
mpaolo opened this issue May 7, 2018 · 11 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@mpaolo
Copy link

mpaolo commented May 7, 2018

that's what I see in the ssl_error.log after latest update, and matomo/site pages are just blank.
reminds me of similar issue long ago

@Findus23
Copy link
Member

Findus23 commented May 7, 2018

@mpaolo I guess you are using the Matomo 3.5.0 release candidate, correct?
Did you enable the new Geoip2 plugin manually? Were you using the https://github.com/diabl0/piwik-geoip2 plugin before?

@sgiehl Did you test what happens when one is using the old Geoip2 plugin at the same time as the new version?

@sgiehl
Copy link
Member

sgiehl commented May 7, 2018

@Findus23 actually not with the current implementation

@mpaolo
Copy link
Author

mpaolo commented May 7, 2018

ATM I just renamed such GeoIp2.php to GeoIp2_php, and got matomo back working ...

@Findus23 yep, on 3.5.0-rc1, Ii think switched to GeoIP PECL time ago, don't remember Ii installed that geopi2 plugin but I see it's installed & active

thx

@Findus23
Copy link
Member

Findus23 commented May 7, 2018

@mpaolo Do you by chance have a geoip2 or similar folder in /var/www/piwik/plugins/ in addition to the GeoIp2 folder? If so it may help removing it and disabling it in config/config.php.ini and then using the new Geoip2 plugin.

@mpaolo
Copy link
Author

mpaolo commented May 7, 2018

ok, seems the usual mismatch/interference between old/new/different implementations.
Since I'm using a different geoip module I guess I'm fine and indeed a quick test confirms geo infos are fine.
So I'll just wait for instructions.

@Findus23 :
/var/www/piwik# locate geoip2|sed -r 's,[^/]+$,,'|sort|uniq
/var/www/piwik/plugins/GeoIP2/vendor/
/var/www/piwik/plugins/GeoIP2/vendor/geoip2/
/var/www/piwik/plugins/GeoIP2/vendor/geoip2/geoip2/
/var/www/piwik/plugins/GeoIP2/vendor/geoip2/geoip2/src/
/var/www/piwik/plugins/GeoIP2/vendor/geoip2/geoip2/src/Database/
/var/www/piwik/plugins/GeoIP2/vendor/geoip2/geoip2/src/Exception/
/var/www/piwik/plugins/GeoIP2/vendor/geoip2/geoip2/src/Model/
/var/www/piwik/plugins/GeoIP2/vendor/geoip2/geoip2/src/Record/
/var/www/piwik/plugins/GeoIP2/vendor/geoip2/geoip2/src/WebService/

@mpaolo
Copy link
Author

mpaolo commented May 7, 2018

oh oh, but there are:
/var/www/piwik/plugins/GeoIp2
/var/www/piwik/plugins/GeoIP2
which one is right?

@sgiehl
Copy link
Member

sgiehl commented May 7, 2018

GeoIp2. The other one is a non-core plugin, that shouldn't be used anymore

@mpaolo
Copy link
Author

mpaolo commented May 7, 2018

hm, so Ii moved out GeoIP2 and renamed the .php, but now the plugin is inactive and I get a waring saying -rc1 is not compat with GeoIP2 plugin

@sgiehl
Copy link
Member

sgiehl commented May 7, 2018

that because the plugin entry is still in the list in config.ini.php. You can remove it manually from that list, or click uninstall if thats possible...

@mpaolo
Copy link
Author

mpaolo commented May 7, 2018

ok, things are becoming a bit messy ...

  • activating the plugin stepped through database update
  • then integrity check wants to remove vendor/maxmind-db/reader/autoload.php
  • PECL geoip no more available, 2 verzions of geopip2 available but not installed (so it says)
  • warning about to be discontinued maxmind db support etc
  • went through the download&install free geoip db, then geopi2 turned 'installed'
  • selected such geopi2, removed such autoload.php, GeoIP2 entries from ini file
    now all seems fine, all warnings gone.
    Guess we can close the issue then - thx @ALL :)

@sgiehl
Copy link
Member

sgiehl commented May 7, 2018

then integrity check wants to remove vendor/maxmind-db/reader/autoload.php

This is a known issue. The file won't be included in next release

@sgiehl sgiehl closed this as completed May 7, 2018
@sgiehl sgiehl added the answered For when a question was asked and we referred to forum or answered it. label May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants