bcit-ci/CodeIgniter · error · RuntimeException
Model.php exists, but doesn't declare class CI_Model
Error message
Model.php exists, but doesn't declare class CI_Model
What it means
Error "Model.php exists, but doesn't declare class CI_Model" thrown in bcit-ci/CodeIgniter.
Source
Thrown at system/core/Loader.php:312
}
// Note: All of the code under this condition used to be just:
//
// load_class('Model', 'core');
//
// However, load_class() instantiates classes
// to cache them for later use and that prevents
// MY_Model from being an abstract class and is
// sub-optimal otherwise anyway.
if ( ! class_exists('CI_Model', FALSE))
{
$app_path = APPPATH.'core'.DIRECTORY_SEPARATOR;
if (file_exists($app_path.'Model.php'))
{
require_once($app_path.'Model.php');
if ( ! class_exists('CI_Model', FALSE))
{
throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model");
}
log_message('info', 'CI_Model class loaded');
}
elseif ( ! class_exists('CI_Model', FALSE))
{
require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php');
}
$class = config_item('subclass_prefix').'Model';
if (file_exists($app_path.$class.'.php'))
{
require_once($app_path.$class.'.php');
if ( ! class_exists($class, FALSE))
{
throw new RuntimeException($app_path.$class.".php exists, but doesn't declare class ".$class);
}
View on GitHub (pinned to 3658d731ea)
When it happens
Trigger: Thrown at system/core/Loader.php:312 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of bcit-ci/CodeIgniter@3658d731ea (2026-08-17).
Data as JSON: /api/errors/205c95e64378b50c.
Report an issue: GitHub.