title: get robots.txt with curl in PHP
body: <p>I am trying to execute a robots.txt HTTP request. For that I am using PHP and curl. This is the code I tried:</p>
  
  <pre><code>&lt;?php
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "robots.txt");
  curl_setopt($ch, CURLOPT_HTTPGET, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.stackoverflow.com'));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $result = curl_exec($ch);
  echo $result;
  </code></pre>
  
  <p>Nothing gets printed to the screen. Any idea what am I missing?</p>