【问题标题】:Codeigniter - An Error Was Encountered - Unable to load the requested class: encryptCodeigniter - 遇到错误 - 无法加载请求的类:加密
【发布时间】:2012-10-21 10:06:16
【问题描述】:

我继承了一个 CI v2.0.2 项目。

出于开发目的,项目已移至另一个子域,database.php 文件已正确重新配置。

登录页面加载正常。但是,在尝试登录后,我收到来自 CI 的错误消息:

An Error Was Encountered 
Unable to load the requested class: encrypt

autoload.php 中,databasesession 库是自动加载的。该文件与主代码库中的文件相同。

如果我在上面的行中添加encrypt 库,我根本看不到登录页面。

以下是日志文件,来自加载登录页面 -

DEBUG - 2012-10-21 04:15:22 --> Config Class Initialized
DEBUG - 2012-10-21 04:15:22 --> Hooks Class Initialized
DEBUG - 2012-10-21 04:15:22 --> Utf8 Class Initialized
DEBUG - 2012-10-21 04:15:22 --> UTF-8 Support Enabled
DEBUG - 2012-10-21 04:15:22 --> URI Class Initialized
DEBUG - 2012-10-21 04:15:22 --> Router Class Initialized
DEBUG - 2012-10-21 04:15:22 --> Output Class Initialized
DEBUG - 2012-10-21 04:15:22 --> Security Class Initialized
DEBUG - 2012-10-21 04:15:22 --> Input Class Initialized
DEBUG - 2012-10-21 04:15:22 --> XSS Filtering completed
DEBUG - 2012-10-21 04:15:22 --> XSS Filtering completed
DEBUG - 2012-10-21 04:15:22 --> XSS Filtering completed
DEBUG - 2012-10-21 04:15:22 --> Global POST and COOKIE data sanitized
DEBUG - 2012-10-21 04:15:22 --> Language Class Initialized
DEBUG - 2012-10-21 04:15:22 --> Loader Class Initialized
DEBUG - 2012-10-21 04:15:22 --> Helper loaded: url_helper
DEBUG - 2012-10-21 04:15:22 --> Database Driver Class Initialized
DEBUG - 2012-10-21 04:15:23 --> Session Class Initialized
DEBUG - 2012-10-21 04:15:23 --> Helper loaded: string_helper
DEBUG - 2012-10-21 04:15:23 --> Session routines successfully run
DEBUG - 2012-10-21 04:15:23 --> Controller Class Initialized
ERROR - 2012-10-21 04:15:23 --> Unable to load the requested class: encrypt

从原始域使用登录时可以正常工作。

我应该从哪里开始寻找任何指针?

【问题讨论】:

  • @GBD:日志也以Unable to load the requested class - encrypt 结尾。用日志更新了上面的问题。
  • 你能检查加密库的文件名到新域的目录吗?
  • @GBD:非常感谢您在这里引起我的注意。 encrypt 库不在 system/libraries 文件夹中。谢谢。如果您发布,我可以将您标记为选定的答案。

标签: php codeigniter autoload


【解决方案1】:

推测该错误是由以下原因之一引起的。

1) 不知何故,库的文件名设法导致 CodeIgniter 无法找到该文件

2) 可能该文件在服务器上不存在,CodeIgniter 又一次找不到它。

3) 文件名可能与您在代码中引用的不同。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-31
    • 2011-12-23
    • 2013-05-14
    • 2018-10-01
    • 2017-08-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多