title: PHP Server Name from Command Line
body: <p>Is there a way to detect the name of the server running a PHP script from the command line? </p>
  
  <p>There are numerous ways to do this for PHP accessed via HTTP.  But there does not appear to be a way to do this for CLI.</p>
  
  <p>For example: </p>
  
  <pre><code>$_SERVER['SERVER_NAME'] 
  </code></pre>
  
  <p>is not available from the command line.</p>