When I try to run Task Schedular on localhost (php version: PHP 5.6.4-4ubuntu6.4 (cli)), it works fine.
crontab
* * * * * php /home/aishatest/public_html/Aisha/Aisha/artisan schedule:run >> /dev/null 2>&1
Application / Console / Kernel.php
<?php namespace App\Console; use App\Console\Commands\CheckOutfitAvailibilityCommand; use App\Http\Controllers\OutfitCronController; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { protected $commands = [
App / Console / Command / CheckOutfitAvailibilityCommand.php
<?php namespace App\Console\Commands; use App\Http\Controllers\OutfitCronController; use Illuminate\Console\Command; class CheckOutfitAvailibilityCommand extends Command { private $outfitCronController; protected $signature = 'CheckOutfitCommand'; protected $description = 'Command description'; public function __construct(OutfitCronController $outfitCronController) { parent::__construct(); $this->outfitCronController = $outfitCronController; } public function handle() {
But when I try to run on CentOs Server (php version PHP 5.6.26 (cli)), it gives an error following
./storage/logs/laravel.log
[2016-09-22 05:54:02] local.ERROR: Kernel [2016-09-22 05:54:05] local.ERROR: exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /home/aishatest/public_html/Aisha/Aisha/vendor/symfony/console/Input/ArgvInput.php:281 Stack trace:
And if I try to execute the command below manually in the terminal, then it works fine.
php /home/aishatest/public_html/Aisha/Aisha/artisan schedule:run
I tried to find a solution, but could not find it.
source share