0

Hello everyone I wonder if someone could help me with this issue I have been using the Twitter API class for over a year now fine. Last week I moved to a grid hosting plan from shared hosting now everytime I use the API get the following errors.

Uncaught exception 'EpiOAuthException' in /home/content/98/3412598/html/twitter/EpiOAuth.php:434 Stack trace: 
#0 /home/content/98/3412598/html/twitter/EpiOAuth.php(404): EpiOAuthException::raise(Object(EpiCurlManager), false) 
#1 /home/content/98/3412598/html/twitter/EpiOAuth.php(45): EpiOAuthResponse->__get('oauth_token') 
#2 /home/content/98/3412598/html/twitter/ufollowme.php(13): EpiOAuth->getAuthenticateUrl() #3 {main} thrown in /home/content/98/3412598/html/twitter/EpiOAuth.php on line 434

I am using this library http://code.google.com/p/php-twitter/downloads/detail?name=php-twitter-1.1.zip&can=2&q=

and here is the simpletest code which I have used all along.

include 'EpiCurl.php';
include 'EpiOAuth.php';
include 'EpiTwitter.php';
$consumer_key = 'REMOVED';
$consumer_secret = 'REMOVED';
$token = 'REMOVED';
$secret= 'REMOVED';
$twitterObj = new EpiTwitter($consumer_key, $consumer_secret, $token, $secret);
$twitterObjUnAuth = new EpiTwitter($consumer_key, $consumer_secret);
?>

<h1>Single test to verify everything works ok</h1>

<h2><a href="javascript:void(0);" onclick="viewSource();">View the source of this file</a></h2>
<div id="source" style="display:none; padding:5px; border: dotted 1px #bbb; background-color:#ddd;">
<?php highlight_file(__FILE__); ?>
</div>

<hr>

<h2>Generate the authorization link</h2>
<?php echo $twitterObjUnAuth->getAuthenticateUrl(); ?>

<hr>

<h2>Verify credentials</h2>
<?php
  $creds = $twitterObj->get('/account/verify_credentials.json');
?>
<pre>
<?php print_r($creds->response); ?>
</pre>

<hr>

<h2>Post status</h2>
<?php
  $status = $twitterObj->post('/statuses/update.json', array('status' => 'This a simple test from twitter-async at ' . date('m-d-Y h:i:s')));
?>
<pre>
<?php print_r($status->response); ?>
</pre>

<script> function viewSource() { document.getElementById('source').style.display=document.getElementById('source').style.display=='block'?'none':'block'; } </script>

Any help welcomed. Thank you

4

1 回答 1

1

如果其他人需要回答 EPIOAUTH.php 文件上的删除行 171-172,请找到修复人员。

   // if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] != '127.0.0.1')
    //  curl_setopt($ch, CURLOPT_INTERFACE, $_SERVER ['SERVER_ADDR']);
于 2012-10-05T13:25:31.540 回答