我有一个使用 CI 版本 2.1.3 在本地安装的 xampp 上运行的站点。代码已放在 git 存储库中。
我将代码克隆到另一台机器上的目录中(也使用相同的路径运行 xammp install)。
现在在“另一台机器”上,它拒绝加载 CI_Controller 类,并给出错误消息;
Fatal error: Class 'CI_Controller' not found in C:\dev\www\my_site\system\core\CodeIgniter.php on line 244
我已经向 system/core/Codeigniter 添加了一些代码来检查发生了什么。这是...
// 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();
}
结果输出是...
file exists
no class
Fatal error: Class 'CI_Controller' not found in C:\dev\www\my_site\system\core\CodeIgniter.php on line 244
所以它正在寻找类,但没有加载它,有什么想法吗?