I am trying to get the code below working on a server running PHP 5.1.4 but it does not appear to be returning anything; print_r($buffer); displays nothing and var_dump($buffer); returns "bool(false)". It works on servers running PHP 5.2.x and 5.3.2 though..

Did you try to invoke that URL in your browser?
–
marioJul 26 '11 at 17:18

turn on curlopt_verbose and log the full exchange somewhere.
–
Frank FarmerJul 26 '11 at 17:18

Your code works fine for me. Try entering your Twitter URL into your browser window and see if that returns anything. If not, either that Twitter service is down or your URL is incorrect.
–
TanoroJul 26 '11 at 17:23

Ok, I tried adding curlopt_verbose but do not see any output logs, also checked the url in the browser and it appears to be working fine but redirects to https:// so I tried that also, but got the same result.
–
tyroJul 26 '11 at 17:36

Thanks, that finally made it spit the error code out: "connect() timed out!". What would be the most likely causes of this in a shared host environment?
–
tyroJul 26 '11 at 18:02

1

Firewall issue, perhaps. Not allowed to have outgoing connections to port 80, or twitter's blocked your server's IP. If you have shell access, you can try telnetting to api.twitter.com:80 and see if that goes through. if it does, then it's something in PHP.
–
Marc BJul 26 '11 at 18:06