安装 CakePHP 2.0 并获取“类‘组件’”未找到”错误

发布于 2025-01-07 06:42:54 字数 364 浏览 0 评论 0原文

我决定不使用迁移指南/shell 将 CakePHP 从 1.3 升级到 2.0,而是直接进行普通安装。由于某种原因,我收到此错误:

Fatal error: Class 'Component' not found in /home/bob_cobb/public_html/mydomain.com/lib/Cake/Controller/Component/SessionComponent.php on line 32

尝试访问我的网站时。 我查看了 SessionComponent.php 是否存在,但它不在我的服务器上,也不在 2.0 存储库中。我需要创建这个文件还是其他什么?(编辑:该文件存在。)

I decided instead of using the migration guide/shell for the upgrade from 1.3 to 2.0 of CakePHP to just go with a vanilla installation of it. For some reason, I'm getting this error:

Fatal error: Class 'Component' not found in /home/bob_cobb/public_html/mydomain.com/lib/Cake/Controller/Component/SessionComponent.php on line 32

When trying to access my website. I looked to see if SessionComponent.php even exists and it doesn't on my server, nor in the 2.0 repository. Do I need to create this file or something? (Edit: The file exists.)

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

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

发布评论

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

评论(3

爱你不解释 2025-01-14 06:42:54

它与 sessionComponent 无关,而是与 Component 类本身有关:

App::uses('Component', 'Controller');

此声明说明了在哪里可以找到它。但蛋糕好像没找到。所以它可能丢失了。
它应该在 /Cake/Controller/

its not about the sessioncomponent but the Component class itself:

App::uses('Component', 'Controller');

This declaration says where to find it. But cake doesnt seem to find it. so it is probably missing.
it should be in /Cake/Controller/

零度° 2025-01-14 06:42:54

实际上, SessionComponent.php 确实存在,至少在官方 2.0.6 存储库中是这样。您的下载/升级可能已损坏。尝试将该文件添加到您的服务器。如果你幸运的话,这是唯一的问题;不过,更有可能的是,您需要重新升级。

Actually, SessionComponent.php does exist, at least in the official 2.0.6 repository. Your download/upgrade was probably corrupted. Try adding the file to your server. If you're lucky, that's the only issue; more likely, though, you'll need to reupgrade.

仙女山的月亮 2025-01-14 06:42:54

我不确定你在哪里寻找,但 SessionComponent.php 确实存在于 2.0.x 存储库中:

https://github.com/cakephp/cakephp/blob/master/lib/Cake/Controller/Component/SessionComponent.php

您可能想要重新- 下载完整的/lib 部分(如果缺少文件)。

I'm not sure where you're looking, but SessionComponent.php does actually exist in the 2.0.x repo:

https://github.com/cakephp/cakephp/blob/master/lib/Cake/Controller/Component/SessionComponent.php

You may want to re-download your whole /lib section if you're missing files.

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