title: PHP Notice: Undefined index: HTTP_HOST in /var/.../script.php on line 8
body: <p>I am getting the same error in my apache error log as described in <a href="https://stackoverflow.com/questions/11363070/php-notice-undefined-index-http-host-in-globalshttp-server-varshttp-host">this question</a>. The only difference is that I am using $_SERVER as described in the answer.</p>
  
  <p>Line 8 is:</p>
  
  <pre><code>if(strstr($_SERVER['HTTP_HOST'],'127.0.0.1'))
  </code></pre>
  
  <p>The same error appears for line 59 which has the exact same conditional. It's a conditional to tell the website whether we are in sandboxing or not. As far as I can tell nothing bad is happened except it is clogging up the apache error log.</p>
  
  <p>Does anyone know why this is happening and how to fix it? The PHP version is 5.3.10. The server is running Ubuntu 12.04.</p>
  
  <p>Thank you.</p>