请帮忙。我最近将一个cakephp应用程序移动到一个新的服务器上,并且无法让最后一点的配置工作。
我们设置了一个cron来每分钟运行一个计划任务。正确调用cron并运行以下脚本:
#! /bin/sh
cd /home/astadm1n/public_html/app/api/app
#cake send_sms
/usr/local/bin/cake send_sms
因此,当我手动在控制台上运行此操作时,我收到以下错误:
astadm1n@autotext.co [~/public_html/app/api/app]# #cake send_sms
astadm1n@autotext.co [~/public_html/app/api/app]# /usr/local/bin/cake send_sms
Error: Could not load class Console
#0 /home/astadm1n/public_html/app/api/lib/Cake/Log/LogEngineCollection.php(41): LogEngineCollection::_getLogger('Console')
#1 /home/astadm1n/public_html/app/api/lib/Cake/Log/CakeLog.php(198): LogEngineCollection->load('stdout', Array)
#2 /usr/local/lib/php/Cake/Console/Shell.php(885): CakeLog::config('stdout', Array)
#3 /usr/local/lib/php/Cake/Console/Shell.php(184): Shell->_useLogger()
#4 /usr/local/lib/php/Cake/Console/ShellDispatcher.php(254): Shell->__construct()
#5 /usr/local/lib/php/Cake/Console/ShellDispatcher.php(200): ShellDispatcher->_getShell('send_sms')
#6 /usr/local/lib/php/Cake/Console/ShellDispatcher.php(68): ShellDispatcher->dispatch()
#7 /usr/local/bin/cake.php(51): ShellDispatcher::run(Array)
#8 {main}
astadm1n@autotext.co [~/public_html/app/api/app]# ^C
astadm1n@autotext.co [~/public_html/app/api/app]#
有人能发现为什么会出现这种错误吗?
感谢您的帮助
麦克
答案 0 :(得分:2)
试试这个: -
* * * * * cd /abs/path/to/app && Console/cake shell_name function_to_run