title: $_SERVER and $_ENV not available if running php from shell
body: <p>I have set up a cron job to run once an hour a script <code>cron/cron.php</code>
  This script simply reads a table to check which scripts should run at a given time.
  So far no problem.
  I just noticed that <code>$_SERVER['DOCUMENT_ROOT']</code> and <code>$_SERVER['SERVER_NAME']</code> is empty. Same to <code>$_ENV['HOSTNAME']</code></p>
  
  <p>What can be the reason? I would prefer to have my <code>cron.php</code> portable so I am searching for a solution which should work on every server.</p>
  
  <p>Thanks in advance for any tips!</p>