title: PHP Error encountered when running Command Line using CodeIgniter 2.xx
body: <p>I have followed the exact guide that is provided on the official codeigniter website for running the CLI (command-line interface) tool. <a href="https://www.codeigniter.com/userguide2/general/cli.html" rel="nofollow noreferrer">https://www.codeigniter.com/userguide2/general/cli.html</a></p>
  
  <p>My controller is...</p>
  
  <pre><code>&lt;?php
  class Tools extends CI_Controller {
  
      public function message($to = 'World')
      {
      echo "Hello {$to}!".PHP_EOL;
      }
  
  } ?&gt;
  </code></pre>
  
  <p>When I run the following command from my CMD I get the following output (and error) in the command line window:</p>
  
  <pre><code>php index.php tools message
  
  &lt;h4&gt;A PHP Error was encountered.&lt;/h4&gt;
  &lt;p&gt;Severity: Notice&lt;/p&gt;
  &lt;p&gt;Message: Undefined index: REMOTE_ADDR&lt;/p&gt;
  &lt;p&gt;Filename: core/Input.php&lt;/p&gt;
  &lt;p&gt;Line Number: 351&lt;/p&gt;
  .....
  &lt;h4&gt;A PHP Error was encountered&lt;/h4&gt;
  &lt;p&gt;Message: Cannot modify header information - headers already sent by (output at C:{systempath}\system\2.1.4\core\Exceptions.php:185)&lt;/p&gt;
  &lt;p&gt;Filename: libraries/Session.php&lt;/p&gt;
  &lt;p&gt;Line Number: 675&lt;/p&gt;
  
  &lt;/div&gt;Hello World!
  </code></pre>
  
  <p>Can anyone explain why I am getting this problem? I am following the tutorial as per the official Codeigniter CLI tutorial too - any ideas? I am using CodeIgniter 2.1.4 with XAMPP (Windows).</p>