![](/img/trans.png)
[英]Cron job not working cakephp 3 on godaddy server through cpanel
[英]cakephp 3 Cron Job not working in cpanel
我正在嘗試在 cakephp 3 shell 腳本中實現 cron 作業,但它在 cpanel 中不起作用。
下面是我的 cron 工作代碼blog is my cakephp 3 folder
cd /home/mmentert/public_html/abc.com/blog && bin/cake hello main
Cakephp 3 shell 類文件
namespace App\Shell;
use Cake\Console\Shell;
use App\Controller\UsersController;
class HelloShell extends Shell {
public function main() {
$userinfo=new UsersController();
$data=$userinfo->useremail();
$this->out($data);
}
}
我假設您使用的是共享主機,CakePHP 3 Docs 上建議的語法不適用於共享主機,這對我有用
php -q -d register_argc_argv=on /home/public_html/bin/cake.php app main
請使用您自己的 cake.php 文件路徑
希望有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.