How to run artisan command schedule:run on hosting server? (Laravel 5.1)

First I create statusUpdate.php file in xampp\htdocs\project\app\Console\Commands folder.

statusUpdate.php :

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use DB;


class statusUpdate extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'status:update';

/**
 * The console command description.
 *
 * @var string
 */
protected $description = 'Update Job status daily';

/**
 * Create a new command instance.
 *
 * @return void
 */
public function __construct()
{
    parent::__construct();
}

/**
 * Execute the console command.
 *
 * @return mixed
 */
public function handle()
{
    $affected = DB::table('jobs')->update(array('status' => 1));
}
}

It created by the following Laravel5 official documentation. Then I add \App\Console\Commands\statusUpdate::class, class in Kernel.php on xampp\htdocs\project\app\Console folder.

Here is karnel.php file code sample:

<?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 = [
        \App\Console\Commands\statusUpdate::class,
];

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

Then I run

php artisan schedule:run using CMD on windows 7.

Now it works fine. My jobs table status field update properly by 1.

But when I use this project on shared hosting added a Cron entry my server in cPanel:

Cron job command is like this : php /path/to/artisan schedule:run 1>> /dev/null 2>&1

Now in this case command not works & this is the problem. how can I solve it?


ANSWERS:


Well. I am giving you the answer as per what you have said.

Cron job command is like this : php /path/to/artisan schedule:run 1>> /dev/null 2>&1

The path should be locating the artisan file in the server. Like this:

Let's say your artisan file location is /var/www/artisan, then the simple answer could be do like this:

php /var/www/artisan schedule:run 1>> /dev/null 2>&1

Just check if that works. Thank You!

UPDATE:

http://i.imgur.com/wVAWAHK.png

This is how it should look like.


This worked fine for me

/usr/local/bin/php /path/to/artisan schedule:run >> /dev/null 2>&1


 MORE:


 ? Running a cron job. All my tests and tries were in vane
 ? Can't run a task schedule in Laravel using cron job in Godaddy
 ? Laravel Cron Job not running commands
 ? Twitter Streaming API
 ? Twitter Streaming API error in PHP
 ? codebird-php Twitter app. Error 77 while validating the Twitter API certificate
 ? Converting Codebird Twitter API Proxy from PHP to CFML
 ? Twitter client application with twitter streaming API in PHP
 ? Laravel command not working as cron
 ? Laravel command not working as cron