title: PHP cURL not fetching webpage
body: <p>As you can see in the code, I am trying to execute an FQL query and retrieve results. The query I generate is completely fine because I have tested it through my browser. I first used file_get_contents() to retrieve the webpage but it was gicing me a 400 Bad Request Error. Somebody suggest cURL instead.</p>
  
  <p>The code segment given below gives me <strong>false</strong> for $query. If I uncomment the urlencode() line, the script goes on and on and hits the maximum execution time limit. What am I doing wrong?</p>
  
  <pre><code>    $limit = $start + 100;
      $query = "select post_id, created_time, actor_id, message, attachment, comments, likes, type  from stream where source_id = $id limit $start, ". $limit;
      $url = "https://graph.facebook.com/fql?q=$query&amp;access_token=$token";
      //$url = urlencode($url);
      echo $url.'&lt;br&gt;';
      $curl_handle=curl_init();
      curl_setopt($curl_handle, CURLOPT_URL, $url);
      curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
      curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($curl_handle, CURLOPT_PROXY, "tcp://10.3.3.3:8080"); 
      curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Hi!');
      $query = curl_exec($curl_handle);
      var_dump($query);
      curl_close($curl_handle);
  </code></pre>
  
  <p>edit: Accessing another URL, file_get_contents gave me this error "failed to open stream: Cannot connect to HTTPS server through proxy". Since this one is also HTTPS, cURL might also be facing the same problem. I thought this might lead to an answer.</p>