Twitter不与本地主机PHP连接


Twitter does not connect with localhost PHP

<?
// here we want to send the article to twitter
require_once('twitteroauth.php');
// Twitter Connection Data
$tConsumerKey       = 'xxxx';
$tConsumerSecret    = 'xxxx';
$tAccessToken       = 'xxxx';
$tAccessTokenSecret = 'xxxx';
// start connection
$tweet = new TwitterOAuth($tConsumerKey, $tConsumerSecret, $tAccessToken, $tAccessTokenSecret);
// the message
$message = 'Auto Tweet via PHP ...';
// send to twitter
$tweet->post('statuses/update', array('status' => $message));
?>

这是我的代码。它不发送post tweet。是关于localhost还是别的什么?我在windows7上使用xampp .

OAuth使用的是哪个库?是你自己做的应用还是别人做的?

如果你可以编辑和检查Twitter开发者区域的设置,这个关于在Twitter应用程序中使用localhost的问题可能对你在验证应用程序时的回调有用。

Twitter oAuth callbackUrl - localhost开发

我发现在开发过程中想要连接应用程序时它很有用。使用127.0.0.1。