I have a site using CI version 2.1.3 running on a xampp install locally. The code has been put in a git repository.
I cloned the code into a directory on another machine (also running xammp install with identical paths).
Now on the ‘other machine’ it refuses to load the CI_Controoler class, giving the error message;
Fatal error: Class 'CI_Controller' not found in C:\dev\www\my_site\system\core\CodeIgniter.php on line 244
I have added some code to system/core/Codeigniter to check what is going on. This is…
// Load the base controller class
require BASEPATH.'core/Controller.php';
function &get_instance()
{
if (file_exists(BASEPATH.'core/Controller.php')) {
echo 'file exists<br />';
if (class_exists('CI_Controller')) {
echo 'class exists<br />';
} else {
echo 'no class<br />';
}
} else {
echo 'no file found<br />';
}
return CI_Controller::get_instance();
}
The resulting output is…
file exists
no class
Fatal error: Class 'CI_Controller' not found in C:\dev\www\my_site\system\core\CodeIgniter.php on line 244
So it is finding the class, but not loading it, any ideas why??
As usual, fault is with sleepy developer!
I enabled full logging in config and found out it was throwing an error regarding the database class; which was due to me having a typo in the database config file.
Changed it and now all is fine.