Codeigniter Command line error - PHP Fatal error: Class 'CI_Controller' not found Codeigniter Command line error - PHP Fatal error: Class 'CI_Controller' not found codeigniter codeigniter

Codeigniter Command line error - PHP Fatal error: Class 'CI_Controller' not found


Solved! (partly) the issue was CodeIgniters error logging.

In application/config/config.php, I modified the following config property:

$config['log_threshold'] = 0;

This disables logging, and allows $ php index.php to execute.

If anyone can explain why CI only shows this error on CLI PHP - might help anyone else who has this issue and needs it resolved with error logging on.


To solve error "Class 'CI_Controller' not found" try going to Application -> Config -> database.php then check the database details like hostname, username, password and database.


To Mijahn:

I had this same problem, and after about two hours of tracing through code to figure out the problem, it seems that there is some sort of conflict with loading the CI_Controller when utilizing the native PHP load_class function.

I worked around this issue by making the following changes to the Common.php file (hack, I know).

//$_log =& load_class('Log');require_once('system/libraries/Log.php');$_log = new CI_Log();

My logs then where created exactly like I wanted. Hope this hack helps.