beingalex
beingalex

Reputation: 2476

Twitter OAuth failing to work (PHP)

I have the TwitterOAuth class and demonstration running on a local development server and I cannot get it to authorize. I have entered the new CONSUMER_KEY and CONSUMER_SECRET in the config.php. I have also synced the server time to NTP. I get the error message: 'Could not connect to Twitter. Refresh the page or try again later.'

var_dump($connection->http_code);

results:

int 0

ANY help or advise would be appreciated.

I am running PHP 5.3

When I try to ping the api server I can't.

C:\Users\Owner>ping api.twitter.com
Ping request could not find host api.twitter.com. Please check the name and try
again.

could this be the problem ?

Upvotes: 0

Views: 2185

Answers (2)

Sachin from Pune
Sachin from Pune

Reputation: 736

step 1: https://apps.twitter.com/app or go to your app setting

step 2: Unchecked the (Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url)) This box..

save and exit and check..

ThankYou..!

Upvotes: 0

William
William

Reputation: 3519

I had some issues with this process as well. I don't exactly recall what resolved this error, but I followed This Tutorial (albeit a bit out of date) and made sure I explicitly set the callback URL in the twitter panel for my app. Also, and I believe this one also caused the int 0 return for me, make sure that if you are going with a hosting provider they allow CURL requests.

Upvotes: 1

Related Questions