[英]Laravel - Cron job not working on live server
我正在使用 laravel 7,我使用 schedule:run 命令创建了一个可以在 localhost 上正常工作但不能在 cpanel 上工作的命令
这是我试图在我的 cpanel 中配置的玉米作业命令。 (我已共享 cpanel 托管)
/usr/bin/php -d register_argc_argv=on /home/flakhost/sashatraders.com/@core/artisan schedule:run >> /dev/null 2>&1
我的 kernel.php 文件代码是
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
Commands\BoostRank::class,
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
$schedule->command('boost:rank')
->everyMinute();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
我相信所有代码都很好,但是我的 cpanel cron 作业命令存在一些问题。 亲切的阅读:
我更新了我的 cron 工作并且它有效
/usr/bin/php -q /home/flakhost/sashatraders.com/@core/artisan schedule:run
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.