-1

I am using laravel 7, I create a command that working properly on localhost with schedule:run command but not working on cpanel
here is my corn job command which I am trying to configure in my cpanel. (I have shared cpanel hosting)

 /usr/bin/php -d register_argc_argv=on /home/flakhost/sashatraders.com/@core/artisan schedule:run >> /dev/null 2>&1 

My kernel.php file code is

<?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');
    }
}

I believe all code is fine but there is some problem in my cpanel cron job command. Kind Reagds:

  • "there is some problem" is not a useful statement. Presumably there is an error in your logs, or if you weren't redirecting all your output to null you might see something useful. – miken32 Dec 03 '20 at 20:29
  • Check your application cron job path properly. And follow the answer link https://stackoverflow.com/questions/44854161/setting-up-a-laravel-cron-job-in-cpanel – Jasim Juwel Dec 03 '20 at 20:46
  • whats the purpose of `-d register_argc_argv=on` ? – Abilogos Dec 03 '20 at 20:49

1 Answers1

0

I updated my cron job and it works


    /usr/bin/php -q /home/flakhost/sashatraders.com/@core/artisan schedule:run