I’m using OAuth.php along with Abraham’s twitteroauth.php version 0.2.0.
The objective is to get my app authorized, store the credentials and do offline posting on the users behalf. I had all this working just fine and then we moved to a new set of servers and upgraded to PHP 5.3.1.
Yesterday I was able to hit the authorization page on twitter and give my app permission but it returned a 401 (see below). This morning we reset the server timezone to CST, changed the timezone in our php.ini to America/Chicago and rebooted and now we don’t even get the Twitter Authorization page, we just get an immediate 401.
I suspect this is all about some setting that Twitter needs for our server so I’m hoping someone will tell me the correct mod to make in OAuth.php->generate_timestamp();
The entries we’ve managed to capture in the error_log are:
[26-Mar-2012 14:43:12 UTC] callback.php: http_code - 401 [26-Mar-2012 14:43:12 UTC] callback.php: http_info - Array ( [url] => https://api.twitter.com/oauth/access_token?oauth_consumer_key=cxxxxxxxxxxxxxxxxxxxxxxx&oauth_nonce=xxxxxxxxxxxxxxxxxxxxxxx&oauth_signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1332772989&oauth_verifier=xxxxxxxxxxxxxxxxxxxxxxxxxx&oauth_version=1.0 [content_type] => text/html; charset=utf-8 [http_code] => 401 [header_size] => 1005 [request_size] => 381 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 3.292677 [namelookup_time] => 0.004509 [connect_time] => 3.067823 [pretransfer_time] => 3.208732 [size_upload] => 0 [size_download] => 1 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 1 [upload_content_length] => 0 [starttransfer_time] => 3.29225 [redirect_time] => 0 [certinfo] => Array ( ) [redirect_url] => ) [26-Mar-2012 14:43:12 UTC] callback.php: http_status - [26-Mar-2012 14:43:12 UTC] callback.php: last_api_call - [26-Mar-2012 14:43:12 UTC] callback.php: request -