I have a Laravel 5.5 installation and am trying to get the scheduler to run. I have the following cron job running and it is working fine.
* * * * * php /var/www/html/project1/artisan schedule:run >> /var/www/html/project1/schedule.log
The cron job is outputting to a log file and I get the same result in cron as I get if I run artisan schedule:run from the command line. The result is always the same and says no scheduled commands are ready to run. The problem doesn't appear to be with cron as the job runs and I get output.
I configured the simple artisan inspire command to run in the Laravel schedule function. I can run the inspire command on the command line with php artisan inspire and it works fine. I understand all the posts about timezone but it is not a timezone issue, the command simply doesn't run ever. I am also not using withoutOverlapping(), so that is not my problem. So I have a cron job running every minute to run the laravel schedule and it does output to my log, which indicates that cron and Laravel are communicating. I think the problem must be that Laravel doesn't think there is a command that needs to be executed. I don't know how to debug this any further so any help would be greatly appreciated.
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
protected $commands = [
//
];
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')
->everyMinute();
}
protected function commands()
{
require base_path('routes/console.php');
}
}