500 error for TwitterOAuth
myinnos opened this issue · 4 comments
myinnos commented
Receiving 500 error
Code
require_once('twitteroauth/autoload.php');
use Abraham\TwitterOAuth\TwitterOAuth;
$connection = new TwitterOAuth($ck, $cs, $ot, $os);
$data = [
'text' => 'Hello world'
];
$connection->setApiVersion('2');
$content = $connection->post("tweets", $data, true);
echo json_encode($content);
Versions:
- TwitterOAuth: v 6.1.0
- PHP: v 7.3.33
It is failing while $connection to TwitterOAuth and has no issue with Twitter keys.
rbaines commented
I'm not affiliated with this code base, but I think v6.x requires PHP 8 or later. That may have something to do with it.
abraham commented
Is the 500 error from Twitter or from your server code? Is the error message?