Moving the site from staging server to production server has resulted in the 400 bad request error. It is exactly the same code that works fine on the staging server. The get_headers request returns the following:
Array ( [0] => HTTP/1.0 404 Not Found [1] => X-RateLimit-Limit: 150 [2] => X-RateLimit-Remaining: 132 [3] => X-RateLimit-Reset: 1338576073 [4] => X-RateLimit-Class: api [5] => Last-Modified: Fri, 01 Jun 2012 17:41:32 GMT [6] => Expires: Tue, 31 Mar 1981 05:00:00 GMT [7] => Pragma: no-cache [8] => Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0 [9] => Set-Cookie: guest_id=“v1:133857249231372253”;Expires=Sun, 1-Jun-14 17:41:32 GMT;Path=/;Domain=.twitter.com [10] => Status: 404 Not Found [11] => X-Transaction: b49bb5d201269094 [12] => X-Frame-Options: SAMEORIGIN [13] => Date: Fri, 01 Jun 2012 17:41:32 GMT [14] => Content-Type: application/xml; charset=utf-8 [15] => Content-Length: 116 [16] => Server: tfe [17] => Connection: Keep-Alive )
Clearly the rate limit is not being reached, plus it shows that it is a 404 error. But when I run the script I get this:
Warning: simplexml_load_file(http://api.twitter.com/1/statuses/user_timeline/the_user_name.xml?count=2&trim_user=true&include_rts=true&exclude_replies=true&contributor_details=true) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
showing a 400 error.
Works on staging server but not live site so it must be hosting environment, but what to look for? Curl is enabled, simpleXML is installed.
Any ideas?