I am getting 403 code and error : Error creating status when i put my script on server


#1

my script was working very good when it was on local ,
but when i put my my script on my server i got this error
{“request”:"/1/statuses/update_with_media.json",“error”:“Error creating status.”}

and when i put the same code in other server i get this error :
{“request”:"/1/statuses/update_with_media.json",“error”:“Timestamp out of bounds”}

can you please help me to solve it ?


#2

here is my php code :

<?php $tmhOAuth = new tmhOAuth(array( 'consumer_key' => $consumerKey, 'consumer_secret' => $consumerSecret, 'user_token' => $oAuthToken, 'user_secret' => $oAuthSecret, )); function tweet_get_id($image, $stutase){ global $tmhOAuth; $code = $tmhOAuth->request( 'POST', 'http://upload.twitter.com/1/statuses/update_with_media.json', array( "media[]" => "@{$image} ", "status" => $stutase, ), true, // use auth true // multipart ); if($code == 200){ $json = json_decode($tmhOAuth->response['response']); if($_SERVER['HTTPS'] == "on") { $image_url = $json->entities->media[0]->media_url_https; }else{ $image_url = $json->entities->media[0]->media_url; } $text = $json->text; $id_str = $json->id_str; $content = "

Upload success. Image posted to Twitter.

". $text . "

". $id_str . "

"; return true; return $id_str; }else{ echo $content = "Damn! Something went wrong. Sorry :-(" ."
code=" . $code ."
status=" . $stutase ."
image=" . $image ."
response=
"
              . print_r($tmhOAuth->response['response'], TRUE)
              . "

info=
"
              . print_r($tmhOAuth->response['info'], TRUE)
              . "

code=
"
              . print_r($tmhOAuth->response['code'], TRUE) . "



"
			  . print_r($tmhOAuth->response, TRUE) . "
"; return false; }

#3

how long it take to answer me ??


#4

This is a public forum… answers sometimes come and sometimes they do not. There’s a rich history in these forums of people with similar issues to the one you’re having and hints on resolving it.

In this case it sounds like on your remote server the system clock isn’t set to the proper UTC time and you’re generating timestamps in your OAuth sequence that are too far off from Twitter’s servers. Verify that the correct time is set on your server and you’ll probably see this issue resolve itself.


#5

Damn! Something went wrong. Sorry :frowning:
code=403