简体   繁体   English

如何在Cpannel中运行laravel cron作业?

[英]How to run laravel cron job in Cpannel?

I want to run cron job every minute in laravel cpanel. 我想每分钟在laravel cpanel中执行cron工作。

Here is my command path 这是我的命令路径

php /home/fwgs/student_route/app/Console/Kernel.php&& php artisan schedule:run >> /dev/null 2>&1

Does anyone know how to add path php artisan schedule:run in cpanel? 有谁知道如何添加路径php artisan schedule:在cpanel中运行?

You can make a command and schedule that command in "app/console/kernel.php" for execution. 您可以在“ app / console / kernel.php”中创建命令并计划该命令以执行。

Then after you need to set the cron using 然后在您需要使用

Command: 命令:

crontab -e

add line in crontab like below: 在crontab中添加行,如下所示:

* * * * * cd /path/to/project/folder && php artisan schedule:run >> /dev/null 2>&1

Above will execute "php artisan schedule:run" command automatically. 上面将自动执行“ php artisan schedule:run”命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM