php Codeigniter - 遇到错误 - 无法加载请求的类:加密
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12996881/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Codeigniter - An Error Was Encountered - Unable to load the requested class: encrypt
提问by Hrishikesh Choudhari
I have inherited a CI v2.0.2 project.
我继承了一个 CI v2.0.2 项目。
For development purposes, the project was moved to another subdomain, and the database.phpfile has been properly reconfigured.
出于开发目的,项目已移至另一个子域,并且database.php文件已正确重新配置。
The login page loads fine. However, after trying to login, I get an error from CI saying:
登录页面加载正常。但是,在尝试登录后,我收到来自 CI 的错误消息:
An Error Was Encountered
Unable to load the requested class: encrypt
In autoload.php, the databaseand sessionlibraries are autoloaded. This file is the same as in the main codebase.
在 中autoload.php,database和session库是自动加载的。该文件与主代码库中的文件相同。
If I add the encryptlibrary in the above line, I'm unable to see the login page at all.
如果我encrypt在上面的行中添加库,我根本看不到登录页面。
Below is the log file, from loading the login page -
以下是日志文件,来自加载登录页面 -
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
The login works fine when used from the original domain.
从原始域使用时,登录工作正常。
Any pointers where I should begin looking?
我应该从哪里开始寻找任何指示?
回答by GBD
Presumably, the error is a result of one of the following reasons.
据推测,该错误是由以下原因之一造成的。
1) Somehow the filename of the library managed to chance causing CodeIgniter to be unable to find the file
1)不知何故,库的文件名设法导致 CodeIgniter 无法找到该文件
2) Perhaps the file doesn't exist on the server and once again, CodeIgniter is unable to find it.
2) 也许该文件在服务器上不存在,再次,CodeIgniter 无法找到它。
3) The filename may be different to that you are referring to in your code.
3) 文件名可能与您在代码中引用的不同。

