Zend Framework 自动加载在部署时不起作用

发布于 2024-09-16 20:57:51 字数 657 浏览 3 评论 0原文

我的基于 Zend 的网站在我的本地主机上完美运行(使用 Mac)。但是当我将其部署在 Linux 网络托管公司上时,出现以下错误:

在索引页面上尝试通过调用资源来列出我的广告,其中选择的是:

致命错误:在 /www/ 中找不到类“Lintotar_Model_Resources_Ad” webvol8/4v/7e33wem4920cqpg/lintottar.se/library/My/Model/Abstract.php 第 79

行在另一个页面上,视图助手似乎正在运行 - 主布局已渲染,但出现以下错误: 致命错误:第 16 行 /www/webvol8/4v/7e33wem4920cqpg/lintottar.se/application/modules/lintottar/views/helpers/SearchForm.php 中未找到类“Lintottar_Form_Search_Simple”

这是我的应用程序 ini:

http://pastie.org/1119934

自动加载有问题吗?我能做什么?我不明白出了什么问题,因为它可以在我的本地计算机上运行。

感谢您的帮助!

KR

约瑟夫

My Zend based website works perfectly on my localhost (using Mac). But When I deploy it on a linux web hosting company, I get the following errors:

On the index page which try to list my ads by calling a resource where the select is:

Fatal error: Class 'Lintottar_Model_Resources_Ad' not found in /www/webvol8/4v/7e33wem4920cqpg/lintottar.se/library/My/Model/Abstract.php on line 79

On another page the view helper seems to be running - the main layout is rendered, but I get the following error:
Fatal error: Class 'Lintottar_Form_Search_Simple' not found in /www/webvol8/4v/7e33wem4920cqpg/lintottar.se/application/modules/lintottar/views/helpers/SearchForm.php on line 16

Here is my application ini:

http://pastie.org/1119934

Is there a problem with the auto loading? What could I do? I can't understand what's wrong since it works on my local computer.

Thank you for your help!

KR

Josef

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

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

发布评论

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

评论(1

秋日私语 2024-09-23 20:57:51

啊,在您显示目录结构后,我明白问题是什么了。问题是这些目录(例如 resourcesadsearch)应该是大写的(例如 Resources) 。它之所以能在 Mac 上运行,是因为尽管 OS X 是基于 UNIX 且区分大小写的,但如果找不到匹配的文件名,它会尝试不区分大小写。

因此,基本上更改文件夹名称以反映实际的类名称,它应该可以工作。请注意,模块目录中的根文件夹,例如 modelsformscontrollersviews 仍应位于小写。模块资源自动加载器就是这样设置的。

Ah I see what the problem is after you showed your directory structure. The problem is that those directories (like resources and ad and search) should be uppercase (eg. Resources). The reason why it works on your Mac is because although OS X is UNIX-based and case-sensitive, if it doesn't find a matching filename, it'll try it case-insensitive.

So basically change your folder names to reflect the actual class names, and it should work. Do note that the root folders in the module directory such as models, forms, controllers and views should still be lower-case. The module resource autoloader is setup this way.

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