I have a VPS which has Piwik installed and WordPress under the same cPanel account. I noticed that when I ran a health check I received this error:
Piwik encoutered an error: Cannot redeclare getdnsattributes() (previously declared in /home/USERNAME/public_html/wp-content/plugins/wordfence/waf/wfWAFGeoIP.php:755) (which lead to: Error in PHP GeoIP provider: The Twig_Environment::clearTemplateCache method is deprecated since version 1.18.3 and will be removed in Twig 2.0. on line 523 of /home/USERNAME/public_html/statistics/vendor/twig/twig/lib/Twig/Environment.php)
If I turned of WordFence firewall I could run the health check. So then after reaching out to WordFence they responded with this:
So it would appear that Pwiki uses the same geoip database that we do and is not checking to see if that library is in use. We already do a "function_exists()" check before declaring the function. If Piwik did the same in their copy of the library, Wordfence and Pwiki would probably work ok together. Reach out to them and ask they fix that.
(Their copy of the GeoIP library, that is.)
Is this a bug?
Lastly I'm finding my php error log growing continually with the same error:
[14-Nov-2016 14:09:28 UTC] PHP Fatal error: Cannot redeclare geoip_load_shared_mem() (previously declared in /home/USERNAME/public_html/wp-content/plugins/wordfence/waf/wfWAFGeoIP.php:241) in /home/USERNAME/public_html/statistics/libs/MaxMindGeoIP/geoip.inc on line 1428
Which health check did you run? Usually WordPress and Piwik is not loaded at the same time
Ah sorry should have given more information.
Ok so I know this is probably not ideal, but it works for me. I have a reseller shared hosting cPanel/WHM plan. Basically on my reseller log in I have the following apps installed via Installatron:
So the health check I'm talking about is the one in Piwik settings itself. It is actually called "System Check" found in ADMINISTRATION => SYSTEM CHECK (under heading DIAGNOSTIC)
Hi @telx85 please note these errors are from the wordfence plugin and not from Piwik, so we cannot help here. Cheers
G'day @mattab according to WordFence the error is Piwik's problem.
I also see this error when I'm running the system check IN Piwik, so as far as WordFence is concerned I don't have issue with that.
This is what I've received back from WordFence Support.
As much as I hate to tell you, since they refuse to fix what is an error in their code there isn't anything we can do.
Hi @telx85 that's correct actually, I didn't read the message properly. Can you try apply this change: https://github.com/piwik/piwik/pull/10987/files#diff-a34ec2f1b090494a615a4abdc9d4046c (the second change) and does it fix issue?
After applying your fix, I haven't had any issue. But I must admit that I don't continually check it, just noticed because I moved hosting and was fixing issues.