CakePHP 1.3 Shell 找不到 AppModel class

CakePHP 1.3 Shell can't find AppModel class

我正在将 CakePHP 1.3 应用程序从旧服务器迁移到新服务器,网站运行正常,但 Shell 失败并出现以下错误:

PHP Fatal error:  Class 'AppModel' not found

并且错误指向从 AppModel class 扩展的模型的声明。它还有点奇怪地将 AppModel class 的内容打印到标准输出。下面是完整的堆栈跟踪。

PHP Fatal error:  Class 'AppModel' not found in /home/andyburchill/src/site/app/models/account.php on line 3
PHP Stack trace:
PHP   1. {main}() /home/andyburchill/src/site/cake/console/cake.php:0
PHP   2. ShellDispatcher->ShellDispatcher() /home/andyburchill/src/site/cake/console/cake.php:665
PHP   3. ShellDispatcher->dispatch() /home/andyburchill/src/site/cake/console/cake.php:139
PHP   4. Shell->initialize() /home/andyburchill/src/site/cake/console/cake.php:337
PHP   5. Shell->_loadModels() /home/andyburchill/src/site/cake/console/libs/shell.php:180
PHP   6. ClassRegistry->init() /home/andyburchill/src/site/cake/console/libs/shell.php:257
PHP   7. App->import() /home/andyburchill/src/site/cake/libs/class_registry.php:143
PHP   8. App->__find() /home/andyburchill/src/site/cake/libs/configure.php:962
PHP   9. App->__load() /home/andyburchill/src/site/cake/libs/configure.php:1043
PHP  10. require() /home/andyburchill/src/site/cake/libs/configure.php:1067

我使用以下命令从根目录 运行 shell:

./cake/console/cake queue

服务器之间最显着的区别是 PHP 版本,shells 在 PHP 5.4.9 上工作,而不在 PHP 5.5 上工作.9.

我已经在谷歌上搜索了几天,通常人们在升级到 CakePHP 2.x 后似乎会遇到此错误,并且修复对 Cake[=31= 不起作用] 1.3.

我开始认为唯一的解决方案是升级到 2.x,但这不是一项简单的任务。

在此期间我可以做些什么来使它正常工作吗?有人可以建议故障排除技巧吗?

好吧,我现在觉得有点傻。

我之前曾尝试过 Raphael 的建议,要求 class 文件,但我决定再试一次,发现 AppModel class 文件以一个简短的开放标签开始,而不是 <?php .

更改后,shell 现在可以工作了。