[eluser]Unknown[/eluser]
I put a fresh install of CI 2.1.3 in /var/www/ci/
I add edit application/controllers/welcome.php so it's contents are the following:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
echo "test\n";
}
}
At this point, if I run
Code:
$ php /var/www/ci/index.php
I get the expected output:
Now I edit config/autoload.php line 55 so that it reads
Code:
$autoload['libraries'] = array('session');
and config/config.php line 227 so that it reads
Code:
$config['encryption_key'] = '348rc9834rc9834nc9834nc';
Now if I run
Code:
$ php /var/www/ci/index.php
I get the following output:
Code:
<div solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined index: REMOTE_ADDR</p>
<p>Filename: core/Input.php</p>
<p>Line Number: 351</p>
</div><div solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: Cannot modify header information - headers already sent by (output started at /var/www/ci/system/core/Exceptions.php:185)</p>
<p>Filename: libraries/Session.php</p>
<p>Line Number: 675</p>
However, if I point my browser to
Code:
http://localhost/ci/
I get the expected output
I would like to run controllers from my command line while still autoloading the session library. Is this possible without editing anything in the system directory?