Fatal error: Cannot redeclare class OAuthSignatureMethod_HMAC_SHA1 in twitteroauth/OAuth.php on line 120


#1

I have tryed many things, but still cant find the solution of this. Can somebody help me?


#2

Hi

This is more a PHP issue than a WordPress issue, but if multiple plug-ins include or require files that declare the same class with the same name, you’ll get a collision. You only need to define the class once, then you can instantiate it as many times as you need in your multiple systems.

You need to update OAuth.php which can be found here https://github.com/abraham/twitteroauth/tree/master/twitteroauth

or simply change OAuth.php

class OAuthException extends Exception {
// pass
}
to

if (!class_exists(‘OAuthException’)) {
class OAuthException extends Exception {
// pass
}
}