升级到PHP 5.4后CakePHP控制台问题

时间:2013-12-14 21:36:50

标签: cakephp cakephp-1.3

我有一个在最近将我升级到PHP 5.4.x的共享主机上运行的CakePHP应用程序。在大多数情况下,一切都进展顺利,但现在我的炮弹不会运行:

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升级,并且可以说明。

非常感谢任何见解。

1 个答案:

答案 0 :(得分:0)

在升级PHP版本的过程中,我的主机决定使用我的php.ini文件玩游戏并且register_argc_argv值已关闭。重新开启正是我所需要的。

另请参阅:https://stackoverflow.com/a/3570142/1665

相关问题