Laravel 5.2 Cron not working on centos
<p>When I am trying to run Task Schedular on localhost(php version : PHP 5.6.4-4ubuntu6.4 (cli)) it is working perfectly. </p>

<p>crontab </p>

<pre><code>* * * * * php /home/aishatest/public_html/Aisha/Aisha/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1
</code></pre>

<p>App/Console/Kernel.php</p>

<pre><code>&lt;?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
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        // Commands\Inspire::class,
        CheckOutfitAvailibilityCommand::class
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        \Log::error("Kernel");
        //$schedule-&gt;command('inspire')
        //         -&gt;everyMinute();
        $schedule-&gt;command('CheckOutfitCommand')-&gt;cron('* * * * *');
    }
}
</code></pre>

<p>App/Console/Command/CheckOutfitAvailibilityCommand.php</p>

<pre><code>&lt;?php

namespace App\Console\Commands;

use App\Http\Controllers\OutfitCronController;
use Illuminate\Console\Command;

class CheckOutfitAvailibilityCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    private $outfitCronController;
    protected $signature = 'CheckOutfitCommand';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct(OutfitCronController $outfitCronController)
    {

        parent::__construct();
        $this-&gt;outfitCronController = $outfitCronController;
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //
        \Log::error("command handle");
        $this-&gt;outfitCronController-&gt;checkOutfitAvailability();
    }
}
</code></pre>

<p>But when I am trying to run on CentOs Server(php version PHP 5.6.26 (cli)) it is giving error as follow </p>

<p>./storage/logs/laravel.log</p>

<pre><code>[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:
#0 /home/aishatest/public_html/Aisha/Aisha/vendor/symfony/console/Input/ArgvInput.php(281): Illuminate\Foundation\Bootstrap\HandleExceptions-&gt;handleError(2, 'Invalid argumen...', '/home/aishatest...', 281, Array)
#1 /home/aishatest/public_html/Aisha/Aisha/vendor/symfony/console/Application.php(743): Symfony\Component\Console\Input\ArgvInput-&gt;hasParameterOption(Array, true)
#2 /home/aishatest/public_html/Aisha/Aisha/vendor/symfony/console/Application.php(114): Symfony\Component\Console\Application-&gt;configureIO(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/aishatest/public_html/Aisha/Aisha/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application-&gt;run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /home/aishatest/public_html/Aisha/Aisha/artisan(35): Illuminate\Foundation\Console\Kernel-&gt;handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 {main}  
</code></pre>

<p>And if I try to run below command manually in the terminal,then also it is works perfectly.</p>

<pre><code>php /home/aishatest/public_html/Aisha/Aisha/artisan schedule:run
</code></pre>

<p>I tried to find the solution, but couldnt find any.</p>