Skip to content

Php artisan schedule:run not working #17156

Closed
@vijaysebastian

Description

@vijaysebastian
  • Laravel Version: 5.2.45
  • PHP Version: 5.6.25
  • Database Driver & Version: Mysql Ver 14.14 Distrib 5.6.31, for osx10.6 (i386) using EditLine wrapper

I am trying Laravel schedule command to run some background process for sending mails and fetching emails. When I run these commands individually using artisan they all run, but when I try to run shcedule:run command to run these commands it shows "No scheduled commands are ready to run."

I've tried to look for an answer but nothing worked. So I tried to rectify the problem by running simple command and check the output. Below is my kernal.php

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
//use App\Model\MailJob\Condition;

class Kernel extends ConsoleKernel {

    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        \App\Console\Commands\Inspire::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param \Illuminate\Console\Scheduling\Schedule $schedule
     *
     * @return void
     */
    protected function schedule(Schedule $schedule) {
        $schedule->command('inspire')->everyMinute();
        dd($schedule);
    }

   
}

when I run schedule:run it shows this output.

BhanuSlthiasMBP:Faveo-Helpdesk-Pro-bhanu-fork vijaysebastian$ php artisan schedule:run
Illuminate\Console\Scheduling\Schedule {#54
#events: array:1 [
0 => Illuminate\Console\Scheduling\Event {#1680
+command: "'/Applications/AMPPS/php-5.5/bin/php' 'artisan' inspire"
+expression: "* * * * * *"
+timezone: null
+user: null
+environments: []
+evenInMaintenanceMode: false
+withoutOverlapping: false
+runInBackground: false
#filters: []
#rejects: []
+output: "/dev/null"
#shouldAppendOutput: false
#beforeCallbacks: []
#afterCallbacks: []
+description: null
}
]
}

But when I remove dd() in schedule() function the output is

BhanuSlthiasMBP:Faveo-Helpdesk-Pro-bhanu-fork vijaysebastian$ php artisan schedule:run
No scheduled commands are ready to run.

Please help me, I am using laravel 5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions