EC2 上的 Codeigniter 应用程序 - 帮助程序未加载

发布于 2024-10-07 07:48:16 字数 440 浏览 3 评论 0原文

我最近刚刚开始将 CI 应用程序迁移到 Amazon 的 EC2 服务。为了进行测试,我设置了一个 ubuntu 的微型实例和一个 LAMP 堆栈。 PHP、MySQL、HTTPD 都运行良好。我现在遇到的一个问题是,当我运行应用程序时,我收到一条错误消息,指出我的助手无法加载。特别是未加载的帮助程序是帮助程序目录中子目录中的帮助程序,即: /var/www/system/application/helpers/subdirectory/foo_helper.php

帮助程序正在自动加载,并且在我的 autoload.php 配置文件中写法如下:

$autoload['helper'] = array('subdirectory/foo', 'foo2',...); 

有人遇到过这个问题,或者有任何指示我可以在我的配置中查看以解决此问题吗?

感谢您的帮助!

I recently just started to migrate over a CI application to Amazon's EC2 service. To test I set up a micro instance of ubuntu and a LAMP stack. PHP, MySQL, HTTPD are all working beautifully. The one issue i'm having now is that when I run my application I receive an error saying that my helpers won't load. The helpers in particular that aren't loading are the ones in subdirectories in the helpers directory ie: /var/www/system/application/helpers/subdirectory/foo_helper.php

The helpers are being autoloaded and in my autoload.php config file they are written like:

$autoload['helper'] = array('subdirectory/foo', 'foo2',...); 

Has anyone run into this issue, or have any pointers on where I could go look in my configuration to resolve this?

Thanks for the help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雪花飘飘的天空 2024-10-14 07:48:16

我会尝试调试 Loader 类的 helper 函数,特别是这些行:

system/libraries/Loader.php

elseif (file_exists(APPPATH.'helpers/'.$helper.EXT))
{ 
    include_once(APPPATH.'helpers/'.$helper.EXT);
}

这是代码当包含应用程序助手时将会受到影响。检查 CodeIgniter 尝试包含的路径。仔细检查路径是否存在 - 每个人都会时不时地犯错;-)

I'd try debugging the helper function of the Loader class, in particular these lines :

system/libraries/Loader.php

elseif (file_exists(APPPATH.'helpers/'.$helper.EXT))
{ 
    include_once(APPPATH.'helpers/'.$helper.EXT);
}

This is the code that will be hit when including application helpers. Check what path CodeIgniter is trying to include. Double check that the path exists - everyone makes typos now and again ;-)

娜些时光,永不杰束 2024-10-14 07:48:16

我认为问题在于,当我从 Windows 迁移到 Linux 时,我忘记考虑 Linux 是区分大小写的。所以现在我需要检查并重命名我的文件和文件夹。

但这仍然无法解决页面似乎被缓存并且我无法刷新并查看我的更改的问题。有没有办法强制页面在每次刷新时从服务器获取新副本?

I think the issue is that when I moved from Windows to Linux I forgot to take into account that linux is case-sensitive. So now I need to go through and rename my files and folders.

But this still doesn't solve the issue where it seems like the page is being cached and I'm not able to refresh and see my changes. Is there any way to force the page to grab a fresh copy from the server on every refresh?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文