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

WordFence and Piwik on same server #10880

Closed
TechCare-Aus opened this issue Nov 17, 2016 · 6 comments
Closed

WordFence and Piwik on same server #10880

TechCare-Aus opened this issue Nov 17, 2016 · 6 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@TechCare-Aus
Copy link

G'day guys,

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

regards,
Steve

@tsteur
Copy link
Member

tsteur commented Nov 17, 2016

Which health check did you run? Usually WordPress and Piwik is not loaded at the same time

@TechCare-Aus
Copy link
Author

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:

  • WordPress (runs my website) has a security plugin called WordFence installed
  • Piwik (runs analytics for me and for my other clients I have on my reseller cPanel hosting)
  • Owncloud (barely use it, but have it for obvious reasons)
  • osTicket (Open Source support ticketing system)

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)

@mattab
Copy link
Member

mattab commented Dec 6, 2016

Hi @telx85 please note these errors are from the wordfence plugin and not from Piwik, so we cannot help here. Cheers

@mattab mattab closed this as completed Dec 6, 2016
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Dec 6, 2016
@TechCare-Aus
Copy link
Author

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.

@mattab
Copy link
Member

mattab commented Dec 9, 2016

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?

mattab added a commit that referenced this issue Dec 12, 2016
@TechCare-Aus
Copy link
Author

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.

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