I am running into problems trying to include TwitterOAuth.php from https://github.com/abraham/twitteroauth to use the Twitter API.
My problem is this: I have a file called twitter.php in the same directory as my TwitterOAuth.php and OAuth.php files. When I try to use this snippet of code to connect:
include("TwitterOAuth.php");
//I actually fill in these values in my code, no worries...
$apikey = //"...";
$apisecret = //"...";
$accesstoken = //"...";
$accesssecret = //"...";
$connection = new TwitterOAuth($apikey, $apisecret, $accesstoken, $accesssecret);
print_r($connection);
I get this error (line 239 is the $connection=new TwitterOAuth(...) line):
Fatal error: Class 'TwitterOAuth' not found in /home/sites/(mydomain)/public_html/twitteroauth-master/src/twitter.php on line 239
However, if I copy and paste the entire contents of the TwitterOAuth.php file, replacing the line at which I call include("TwitterOAuth.php"); with those contents, everything works fine. I've also tried using include_once, require, and require_once, to no avail.
Please advise - I am very new to PHP and have no idea why copying and pasting works when include() doesn't.
Thanks!