Im doing an application using Abraham/twitterOauth library which works fine on Windows 10 using xampp with php7.0.
Favoriting and retweeting works as intended on Windows 10 but as soon as I host the site on a linux machine favorite and retweet stops working "no status found with that ID".
Everything else works fine on linux, posting tweets, with and without media, fetching timeline and fetching user data. All above works just not favorite and retweet.
Currently i am using angular http from my html to call the php script
$http.get('php/twitter_calls.php', {
params: {
func: 'favorite',
tweetId: tweet.id
}
}).then(
function (data) {
// success, process data
}),
function (data) {
// failure
console.log("error: ", data);
};
I am sure that the status ID is correct because, it works fine on Windows and the id sent along matches the original id exactly.
I respond the the call in my php file as
if(isset($_GET['tweetId'])){
$tweetId = intval($_GET['tweetId']);
$response = $twitter->post(
"favorites/create", [
"id" => $tweetId
]
);
var_dump( $response); // debugging. this outputs - see below
if($twitter->getLastHttpCode() == 200){
echo "ok";
}
else{
echo http_response_code(500);
}
}
else{
echo http_response_code(400);
echo "failed to get id";
}
the output from the vardump is:
object(stdClass)#139 (1) { ["errors"]=> array(1) { [0]=> object(stdClass)#3 (2) { ["code"]=> int(144) ["message"]=> string(29) "No status found with that ID." } } }
As i mentioned before, this works fine on Windows but why not on linux?
Edit: Var dumping $tweetId gives identical output to the id from when the tweet was fetched.
The linux machine is also running xampp with php7.0. also tried on a raspberry with apache2 and php7.0