Problem related to auto Twitt PHP Script


I am using Twitter OAuth For Auto Tweet in My PHP Account,
but unfortunately i cant get My Status Post…

I had tried Both method for status Updates but its not working,
Can you please help me for this,

Code which i am using is given below…

----------First Method using OAuth ----

$consumerKey    = 'MYCONSUMERKEY';
$consumerSecret = 'MYCONSUMERSECRET';
$oAuthToken     = 'MYAUTHTOKEN';
$oAuthSecret    = 'MYAUSECRET';


$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);

$tweet->post('statuses/update', array('status' => 'PHP auto post tweet to Twitter. Read more:'));

When i am using this i didnt get any error but tweet is not post on my twitter account

----------Second Method using CURL LIberary----

// The message you want to send
$message = ''PHP auto post tweet to Twitter.
// The twitter API address
// Alternative JSON version
//$url = '';
// Set up and execute the curl process
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST,1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS,"status=".$message);
curl_setopt($curl_handle, CURLOPT_USERPWD,"$username:$password");
$buffer = curl_exec($curl_handle);
// check for success or failure
if (empty($buffer)) {
    echo 'Try again';
} else {
    echo 'success';

i got success message but the tweet is not post on my account


Hope you Will Give me solution of this as soon as possble


Munir Vora


Make sure you understand how the libraries you’re using interact with the API. twitteroauth allows you to make requests to unversioned paths – you should make sure you’re instructing it to use

Your second approach is to an outdated endpoint and using “basic auth” (username and password) which is not supported by the API.




لا يبدو انهو جيد