安装 CakePHP 2.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它与 sessionComponent 无关,而是与 Component 类本身有关:
此声明说明了在哪里可以找到它。但蛋糕好像没找到。所以它可能丢失了。
它应该在
/Cake/Controller/
中its not about the sessioncomponent but the Component class itself:
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/
实际上,
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.我不确定你在哪里寻找,但 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.