【发布时间】:2015-04-14 21:10:39
【问题描述】:
我一直在我的 Mac 上使用 CodeIgniter 开发一个 Web 应用程序,没有任何问题。我正在使用 Ion Auth 库进行用户身份验证。我没有将该站点移植到生产服务器,并且出现以下错误:
An Error Was Encountered
Unable to locate the model you have specified: Ion_auth_model
这里的所有帖子似乎都是文件放置或文件名或类名的大小写。我已经四次检查了 ion auth 模型代码..
/application/models/ion_auth_model.php
class Ion_auth_model extends CI_Model{
...
}
加载模型的唯一位置是在 ion auth 库中:
/applicaiton/libraries/ion_auth.php
$this->load->model('ion_auth_model');
最令人沮丧的是 - 它在我的开发系统上完美运行。我的 prod 和 dev 环境之间的唯一区别是数据库配置(我什至现在将它置于开发模式,所以我可能会看到一个错误。
没有日志条目,页面上没有有用的错误,CodeIgniter 根本没有任何帮助来指导我错误的来源。
谁能指出我正确的方向来解决这个问题????
【问题讨论】:
-
在库中,
echo APPPATH;产生了什么? -
回显 APPPATH;返回“/home/whiteatom/new-app/application/” - 我的应用程序文件夹的正确路径。
-
确保您的文件名格式正确。类文件名必须是 Ucfirst,其他所有内容都必须小写。在你的情况下 Ion_auth_model.php 而不是“ion_auth_model”
-
我所有的模型都有小写的文件名,带有 ucfirst 类名。这不正确吗??
-
如果您使用的是 codeigniter 3,那么文件名应该以大写开头。
标签: php codeigniter module ion-auth codeigniter-3