Q:

curl not working in localhost linux fedora

Hi i tried the google search api using curl from my local linux fedora machine, but i am not getting any result . The curl in not working in my local machine i suppose. how to make it work. here is my code. 
<?php         
echo $url = "https://ajax.googleapis.com/ajax/services/search/video?=1.0&q=iphone&userip=1xx.1xx.5x.6x";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_REFERER,"www.example.com"); 
$body = curl_exec($ch); 
curl_close($ch);
$json = json_decode($body);
print_r($json);
?>

A:

You have to Install php5-curl and Enable cURL extension from php.ini.

Linux command  for install cURL
apt-get install curl libcurl3 php5-curl

search extension=curl.so in php.ini and remove ';'.

