I’m having an issue with the PECL OAuth extension for PHP. My code is below:
define("TWITTER_CONSUMER_KEY", "consumer-key");
define("TWITTER_CONSUMER_SECRET", "consumer-secret");
$oauth = new OAuth(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET);
$oauth->setToken('valid-token', 'valid-key');
var_dump($oauth->fetch('https://api.twitter.com/account/verify_credentials.json'));
Whenever I load the page this code is on, instead of producing output in my browser, my browser attempts to download a blank file with the same name as the PHP script. Anyone have any ideas? Has anyone successfully used the PECL OAuth extension with twitter?