lanice51 发表于 2014-5-4 13:38:35

Unable to load the requested class: cache 错误解决方案

版本:2.1.4
现象:在window下开发,加载 dirver,cache 正常使用,在linux下出现:
Unable to load the requested class: cache错误;


解决方法:
经过一番折腾,没办法从源码入手,找到问题在 system/core/Loader.php
945行                                $filepath = $path.'libraries/'.$subdir.$class.'.php';


加上 ucfirst即:$filepath = $path.'libraries/'.ucfirst($subdir).$class.'.php';


问题解决。
另外需要注意的是:Unable to load the requested class:这样的提示,很多情况是应为要加载的文件不存在,不是上面提到的路径问题。

Hex 发表于 2014-5-4 13:56:28

是不是楼主没有按照 CI 规定大小写命名文件名?

lanice51 发表于 2014-5-4 14:42:06

我对照了一下 ,用的是系统自带的cache,文件名一模一样,没有问题。那或许可能是我改动内核其他地方造成的这个错误。


我开发的另一个系统确实没有这样的问题。
页: [1]
查看完整版本: Unable to load the requested class: cache 错误解决方案