升级到PHP5.4后出现CakePHP控制台问题

升级到PHP5.4后出现CakePHP控制台问题,cakephp,cakephp-1.3,Cakephp,Cakephp 1.3,我有一个运行在共享主机上的CakePHP应用程序,该主机最近将我升级到PHP5.4.x。大部分情况下,一切进展顺利,但现在我的外壳无法运行: CakePHP Console: This file has been loaded incorrectly and cannot continue.Please make sure that /cake/console is in your system path,and check the manual for the correct usage of

我有一个运行在共享主机上的CakePHP应用程序,该主机最近将我升级到PHP5.4.x。大部分情况下,一切进展顺利,但现在我的外壳无法运行:

CakePHP Console: This file has been loaded incorrectly and cannot continue.Please make sure that /cake/console is in your system path,and check the manual for the correct usage of this command.
深入查看
cake/console/cake.php
,故障似乎发生在该块中:

if (!isset($this->args[0]) || !isset($this->params['working'])) {
# debug($this->args);
# debug(isset($this->args[0]));
  $this->stderr("\nCakePHP Console: ");
  $this->stderr('This file has been loaded incorrectly and cannot continue.');
  $this->stderr('Please make sure that ' . DIRECTORY_SEPARATOR . 'cake' . DIRECTORY_SEPARATOR . 'console is in your system path,');
  $this->stderr('and check the manual for the correct usage of this command.');
  $this->stderr('(http://manual.cakephp.org/)');
  $this->_stop();
}
具体来说,
$this->args
数组是空的,因此没有
0
索引。此应用程序正在运行CakePHP 1.3.17。我检查了另一个运行1.3.16的应用程序,
cake
脚本和
cake.php
文件完全相同。但是,在1.3.16站点上,
$this->args[0]
值被正确设置为被调用脚本的路径

你知道为什么我新升级的网站不会收到相同的发送值吗?这是一个已经几个月没碰过的应用程序。据我所知,唯一的变化是PHP升级


任何洞察都将不胜感激。

在升级PHP版本的过程中,我的主机决定使用我的PHP.ini文件玩游戏,并且
register\u argc\u argv
值被关闭。打开它正是我所需要的


另请参见:

在使用Cake 1.3时,我们在升级到PHP5.3之后遇到问题-如果您必须升级到PHP5.3之后,您可能还必须升级Cake core(以及所有不推荐使用的函数,以及随后返回不同结构的不向后兼容查询函数)。