今天将自己做的项目提到服务器上,本来信心满满的等着跑流程测试,结果配好路径后,一直报错:
排查 CI Unable to load the requested file
排查 CI Unable to load the requested file
排查 CI Unable to load the requested file
排查 CI Unable to load the requested file
顿时懵逼。。。于是开始了排查过程
1、首先想到的是文件权限的问题,结果查看目录都是755, 文件都是644,不可能只有这个文件加载不到,故排除
2、再者想到是否是加载名字的大小写问题,查看autoload.php,为:
$autoload['helper'] = array('Other');
接着看文件名 Other_helper.php,统一,故排除
3、最后注意到报错提示是 helpes/other_helper.php, 难道是小写的?于是mv改名,再看,报错排除!!!
 
反思:
1、报错提示比较明显,要仔细看报错
2、为什么我定义的是大写,而会加载小写的?
 
追踪:
1、查看CI_Controller.php
排查 CI Unable to load the requested file
排查 CI Unable to load the requested file
因为我用的是autoload,故接着查看Loader.php
2、
排查 CI Unable to load the requested file
排查 CI Unable to load the requested file
3、
排查 CI Unable to load the requested file
排查 CI Unable to load the requested file
因为是helper问题,故
4、
排查 CI Unable to load the requested file
排查 CI Unable to load the requested file
通过_ci_prep_filename生成文件名,故
5、
排查 CI Unable to load the requested file
排查 CI Unable to load the requested file
找到原因!!!
 
end
 

相关文章: