title: cURL error: Could not resolve host
body: <p>A similar question has been posted at but i could not find the solution there
  <a href="https://stackoverflow.com/questions/1298125/curl-error-could-not-resolve-host-saved-report-xml-no-data-record-of-requested">Curl error Could not resolve host: saved_report.xml; No data record of requested type&quot;</a></p>
  
  <pre><code>&lt;?php
  
  $url="http://en.wikipedia.org/wiki/Pakistan";
   $ch = curl_init(urlencode($url));
    echo $ch;
    // used to spoof that coming from a real browser so we don't get blocked by some sites
    $useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
  
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);
    curl_setopt($ch, CURLOPT_TIMEOUT, 8);
    curl_setopt($ch, CURLOPT_LOW_SPEED_TIME, 10);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
    $content = curl_exec($ch);
  
  
  
    $info = curl_getinfo($ch);
  
  if ($content === false || $info['http_code'] != 200) {
    $content = "No cURL data returned for $url [". $info['http_code']. "]";
    if (curl_error($ch))
      $content .= "\n". curl_error($ch);
    }
  else {
    // 'OK' status; format $output data if necessary here:
    echo "...";
  }
    echo $content;
    curl_close($ch);
  ?&gt;
  </code></pre>
  
  <p>when i paste the same address in browser i am able to access the webpage. but when i run this script i get the error message. Can anyone please help me.
  Thanks</p>