CakePHP2-从外壳运行时出错

时间:2018-07-11 09:39:25

标签: shell cakephp

我目前正在寻求通过Cron生成报告,以自动浏览记录并根据特定条件向用户发送警报电子邮件。

Console命令工作正常,但是当我从命令行运行时,我得到了

PHP Notice: Undefined variable: argv in /home/airleagu/deploys/admin_develop/Console/cake.php on line 46
Error: This file has been loaded incorrectly and cannot continue.
Please make sure that /lib/Cake/Console is in your system path,
and check the cookbook for the correct usage of this command.
(https://book.cakephp.org/ 1)
#0 /home/airleagu/deploys/admin_develop/Cake/lib/Cake/Console/ShellDispatcher.php(54): ShellDispatcher->_initEnvironment()
#1 /home/airleagu/deploys/admin_develop/Cake/lib/Cake/Console/ShellDispatcher.php(65): ShellDispatcher->__construct(NULL)
#2 /home/airleagu/deploys/admin_develop/Console/cake.php(46): ShellDispatcher::run(NULL)
#3 {main}

我正在从cron运行的命令是

cd /home/airleagu/deploys/admin_develop && Console/cake reminder_wwcc   

我已经进行了一些研究,发现我需要使用“ register_argc_argv”,但是我也被认为该标志是一种不良的安全习惯。

正在寻找反馈/建议-预先感谢

0 个答案:

没有答案