Friday 12 February 2016

php - laravel error cron uses



Laravel error




cron uses /usr/bin/php /home/sitevk/artisan schedule:run 1>>
/dev/null: 2>&1





App\Console\Kernel:



use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\User;
use Log;

class Kernel extends ConsoleKernel
{

/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\App\Console\Commands\Inspire::class,
];

/**

* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
Log::info('1');
$schedule->call(function () {
$user = User::find(1);

$user->first_name = 'cron...';
$user->save();
})->everyMinute();
}
}


Logs:





[2015-08-31 19:14:02] local.ERROR: exception 'ErrorException' with
message 'Invalid argument supplied for foreach()' in
/home/sitevk/vendor/symfony/console/Input/ArgvInput.php:287 Stack
trace:
#0 /home/sitevk/vendor/symfony/console/Input/ArgvInput.php(287): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2,
'Invalid argumen...', '/home/sitevk/ve...', 287, Array)
#1 /home/sitevk/vendor/symfony/console/Application.php(827): Symfony\Component\Console\Input\ArgvInput->hasParameterOption(Array)
#2 /home/sitevk/vendor/symfony/console/Application.php(123): Symfony\Component\Console\Application->configureIO(Object(Symfony\Component\Console\Input\ArgvInput),
Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/sitevk/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(100):
Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput),
Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /home/sitevk/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput),
Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 {main}




Answer



It was necessary to put a higher version of php


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...