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

Status:Active» Postponed (maintainer needs more info)

Since 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?

I don't have that class declaration any where else in my code. The only place I find it is in oauth/oauth.lib.php

Then I guess someone is including our file twice - can that be correct? It should only be included using require_once() or include_once()

I 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.

First: 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.

Status:Postponed (maintainer needs more info)» Active

friendconnect 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.

grepped my entire drupal code base with the following:

egrep 'class OAuthException' * -ir

Found nothing. Could it be autoloaded somewhere?

I have this issue with the http://drupal.org/project/gigya modules installed.

Issue logged here: http://drupal.org/node/1044302#comment-4021198

@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.

Status:Active» Closed (won't fix)

As these errors seems to be caused by other modules I'm closing this as a won't fix.

We resolved the "Fatal error: Cannot redeclare class OAuthException" error by disabling OAuth in our php installation.

same problem here. dont have OAuth anywhere other than on a subdirectory installation of StatusNet

This 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

I 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.

Status:Closed (won't fix)» Active

Fatal 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

Post removed, resolved my issue with this!

Status:Active» Closed (duplicate)

This is caused by the PECL extension of PHP see #1439254: Fatal Conflicts with PHPs OAuth extension

I 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