Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
WSOD with Cannot redeclare class OAuthException in drupal6/sites/all/modules/oauth/oauth.lib.php on line 17, referer: https://myurl.com/user in apache2 error logs.
Not certain what the issue is or if this method is required for something else, but commenting out the OAuthException class from line 14 to 17 fixed the issue and got the twitter OAuth working as well.
/**
* Generic exception class
class OAuthException extends Exception {
// pass
}
*/
Comments
Comment #1
voxpelli CreditAttribution: voxpelli commentedSince this module has worked for most people there has to be something specific with your installation that makes this break.
Are you using any other OAuth-related modules that might contain OAuthException in them?
Comment #2
SpiesInOrbit CreditAttribution: SpiesInOrbit commentedI don't have that class declaration any where else in my code. The only place I find it is in oauth/oauth.lib.php
Comment #3
voxpelli CreditAttribution: voxpelli commentedThen I guess someone is including our file twice - can that be correct? It should only be included using require_once() or include_once()
Comment #4
AndyThornton CreditAttribution: AndyThornton commentedI am getting this problem too.
Fatal error: Cannot redeclare class OAuthException in /home/mfcnyorg/public_html/sites/all/modules/oauth/oauth.lib.php on line 17
I installed OAuth to get the twitter module to work again (it has been broken since twitter forced use to use OAuth). That would suggest to me that I dont have another module that would be including the library. I thought maybe it was something in my PHP environment - i am using a shared hosting account with bluehost, but what is weird is that I have another bluehost shared account for a different site and it works fine. Both are using the same version of OAuth and twitter module.
Comment #5
voxpelli CreditAttribution: voxpelli commentedFirst: If you update with more info please change the status of an issue to active so that people will notice it
Regarding the problem: Open up your entire site's code base and search for "OAuthException" in it and see if any other file than the sites/all/modules/oauth/oauth.lib.php contains it.
All modules are free to not use this module for their OAuth purposes and to include conflicting code in their own modules instead - so you might have the OAuthExpection class elsewhere. The Twitter module has chosen to use this module to among other things avoid such conflicts.
As you confirm yourself - it works well on most installations so I will leave the status as needing more info. Once you find the module that contains the conflicting code - open an issue and see if it might be possible for them to use the OAuth module instead.
Comment #6
AndyThornton CreditAttribution: AndyThornton commentedfriendconnect was the module is conflict (http://drupal.org/project/friendconnect)
i've opened an issue (http://drupal.org/node/1012772). may not be fixed easily, though as it comes from a library they use.
Comment #7
SpiesInOrbit CreditAttribution: SpiesInOrbit commentedgrepped my entire drupal code base with the following:
egrep 'class OAuthException' * -ir
Found nothing. Could it be autoloaded somewhere?
Comment #8
mrfelton CreditAttribution: mrfelton commentedI have this issue with the http://drupal.org/project/gigya modules installed.
Issue logged here: http://drupal.org/node/1044302#comment-4021198
Comment #9
voxpelli CreditAttribution: voxpelli commented@mrfelton: I think Gigya includes a library similar to the OAuth module which results in a conflict. Gigya could avoid this by supporting the OAuth module.
Comment #10
voxpelli CreditAttribution: voxpelli commentedAs these errors seems to be caused by other modules I'm closing this as a won't fix.
Comment #11
hansait CreditAttribution: hansait commentedWe resolved the "Fatal error: Cannot redeclare class OAuthException" error by disabling OAuth in our php installation.
Comment #12
liza CreditAttribution: liza commentedsame problem here. dont have OAuth anywhere other than on a subdirectory installation of StatusNet
Comment #13
yngens CreditAttribution: yngens commentedThis error started to happen on my site since last update of Twitter module to recommended version 6.x-3.0-beta9
Fatal error: Cannot redeclare class OAuthException in /sites/all/modules/oauth/oauth.lib.php on line 17
Comment #14
ErikWegner CreditAttribution: ErikWegner commentedI had this issue, too. It was because I updated from 2.02 to 3.0b4 without removing the module directory, instead I just put all files into the existing directory. After deleting the oauth directory and placing a fresh version, the error is gone.
Comment #15
venusrising CreditAttribution: venusrising commentedFatal error: Cannot redeclare class OAuthException in /home/OURSITE/html/sites/all/modules/oauth/lib/OAuth.php on line 8
Does anyone know how this may be fixed we are confused. I know twitter uses ouath
Comment #16
Cyberwlf CreditAttribution: Cyberwlf commentedPost removed, resolved my issue with this!
Comment #17
Frans CreditAttribution: Frans commentedThis is caused by the PECL extension of PHP see #1439254: Fatal Conflicts with PHPs OAuth extension
Comment #18
ianims CreditAttribution: ianims commentedI found this error to be due to the following:
OAuth 6.x-3.0-beta4 Provides OAuth functionality
Depends on: Autoload (enabled)
Required by: OAuth Provider UI (disabled), Twitter actions (enabled), Twitter Post (enabled), Twitter Signin (enabled)
OAuth Provider UI 6.x-3.0-beta4 Provides a UI for when OAuth is acting as a provider.
Depends on: OAuth (enabled), Autoload (enabled)
In modules->Oauth in my version there are two checkboxes, the second one (OAuth Provider UI) when
unchecked solved this problem for me