OAuth code works on one website but not another


I apologise as I’m sure this is really obvious but not only am I new to Twitter development but also OAuth… Anyway, I foolishly was using some API 1 code and had to update it today for a website I’ve been working on.

But when I test out the new code - all I am looking for is the return of one tweet as “plain text” - on one website it works fine, but then not on the client’s website. Here they are - the two files are identical - they are only a fragment of an includes php file so they don’t make a lot of sense on their own… <//edit website removed now that it’s solved//>> - where you can see the Twitter text showing on the right (starting @…) while on the client’s website, this is missing altogether: <//edit website removed now that it’s solved//>>

As far as I know I’ve got the latest OAuth library downloads but I did notice that the client’s website also has it on its server

/Request engine support php_streams, curl
source version $Id: oauth.c 313600 2011-07-22 16:48:24Z jawed $
version 1.2.2

Part of my coding:
function getTwitterWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
$twittercon=getTwitterWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);

I even created a new key/token with parameters all specifically for the client site and that didn’t change anything…


OK, I’ve narrowed it down to the OAuth.php - for some reason it’s not being parsed correctly on the client site (“server error…”) - I’ve tried two different versions of it, and it’s still the same (http://oauth.googlecode.com/svn/code/php/OAuth.php and https://github.com/abraham/twitteroauth/tree/master/twitteroauth)… I don’t know what it’s clashing with as the file is rather large! Anyone got any clues?

I’ve tried not using it, and relying on the server’s OAuth support but that didn’t work either…


After trying to manually debug, I eventually waded through pages and pages (thanks to Google) to end up with a simple solution: all I’ve done is commented out the class ‘OAuthException extends Exception’ in OAuth.php - and it works. So this is now solved - not sure if it will help anyone else