skip to Main Content

I’m using Namecheap Hosting. And my files are in a subdomain. I’ve added a task scheduler in Kernel.php file and add cron jobs in hosting. But it’s not working. When I manually run schedule command it works perfectly. Can anyone please see the below code and details and tell me what am I missing?

Kerner.php file:

protected function schedule(Schedule $schedule)
    {
        $schedule->command('add:earnLeave')
        ->everyMinute()
        ->timezone('Asia/Dhaka');
    }

Cron Command:

/usr/local/bin/php /https://subdomain.maindomain.com/php artisan schedule:run >> /dev/null 2>&1

and in my hosting the minimum run time is every five minutes */5 * * * *
and my task scheduler will run once on the last day of the month. For testing purposes, I set it to every minute. Should I have to keep this run time equal to cron jobs?

What should I do now?

2

Answers


  1. Chosen as BEST ANSWER

    I have solved this problem myself. I use /usr/bin/php instead of usr/local/bin/php And also proc_open was disabled. After enabling it, now it's working fine.


  2. Domain name no needed.

    /usr/local/bin/php /home/username/public_html/laravelrootfolder/artisan schedule:run >> /dev/null 2>&1
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search