I've got some inherited code that uses the OEmbed PHP Library to get the embed code for a Vimeo video. As of sometime today (1/31/2014) it started freezing when curl_exec function is called within that library. Before today this code has been working perfectly fine. Thinking it is some problem with the server I brought the code to my local development machine and to my surprise it freezes there as well.
To try to come up with a simple reproducible bit of code I extracted just the curl download of the JSON info into the following script:
<?php
$url = "http://vimeo.com/api/oembed.json?url=http%3A%2F%2Fvimeo.com%2F64279006&maxwidth=&maxheight=&format=json";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
if($data = curl_exec($ch)){
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($http_code >= 200 && $http_code < 300){
$result["success"] = true;
$result["data"] = $data;
$result["http_code"] = $http_code;
}else{
$result["success"] = false;
$result["http_code"] = $http_code;
$result["url"] = $url;
}
}else{
$result["success"] = false;
$result["curl_error_code"] = curl_errno($ch);
};
curl_close($ch);
print_r($result);
Interesting enough if I change URL to "http://vimeo.com/api/oembed.json?url=http%3A%2F%2Fvimeo.com%2F64279006", "http://vimeo.com/api/oembed.json" or even just "http://vimeo.com/" then I get the same behavior. But if I change it some some other non vimeo URL it works fine.
Anybody have any idea why it might be freezing up?
Exact same problem here. Started today. I can curl the same URL from the command line, but when I hit it from PHP it freezes. I can curl to YouTube fine. Just not Vimeo. WTF.
Same problem this afternoon on our server: vimeo slow, and our server almost freezed