【发布时间】:2018-10-25 04:30:46
【问题描述】:
我在尝试设置我们正在运行的站点的测试副本时遇到问题,我在 Mint VM 下安装了文件和应用程序,当我将 apache 指向该目录时,我收到 500 错误和以下错误-
[Thu Oct 25 15:09:39.714201 2018] [php7:error] [pid 8945] [client 192.168.0.14:52237] PHP Fatal error: Cannot use 'Object' as class name as it is reserved in /home/jamesmcgrath/Documents/dashboard/lib/Cake/Core/Object.php on line 30
[Thu Oct 25 15:09:39.714547 2018] [php7:error] [pid 8945] [client 192.168.0.14:52237] PHP Fatal error: Uncaught Error: Class 'Controller' not found in /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ExceptionRenderer.php:174\nStack trace:\n#0 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(InternalErrorException))\n#1 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct(Object(InternalErrorException))\n#2 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ErrorHandler.php(284): ErrorHandler::handleException(Object(InternalErrorException))\n#3 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ErrorHandler.php(213): ErrorHandler::handleFatalError(64, 'Cannot use 'Obj...', '/home/jamesmcgr...', 30)\n#4 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Core/App.php(933): ErrorHandler::handleError(64, 'Cannot use 'Obj...', '/home/jamesmcgr...', 30, Array)\n#5 /home/jamesmcgrath/Documents/dashboard/lib/Cake/Core/App.php(906): App::_checkFatalError()\n#6 [internal function]: App::shutdow in /home/jamesmcgrath/Documents/dashboard/lib/Cake/Error/ExceptionRenderer.php on line 174
奇怪的是,我们直接从运行正常的网络服务器中提取了文件。第一个错误让我相信这是由于 php 或 apache 版本根据我在其他地方读到的内容而有所不同(工作的网络服务器是 7.1.10,而测试的网络服务器是 7.2.10,我无法确定哪个版本的apache 网络服务器正在运行)。
我不确定这两个错误是否相关,我还在习惯这种环境,所以处理这些东西的进度很慢。
任何帮助都将不胜感激。
【问题讨论】:
-
由于错误状态
Object是保留关键字。您不能将它用于您的课程。您必须为您的班级使用其他名称。只需将您的类名更改为其他名称即可解决此错误。 -
我遇到了第一个错误,因为错误的php版本。第二个,还没有。
标签: php cakephp php-7.2 cakephp-2.2 cakephp-2.x