当我试图在localhost(php版本:PHP 5.6.4-4ubuntu6.4(cli))上运行Task Schedular时,它运行正常.
crontab中
* * * * * php /home/aishatest/public_html/Aisha/Aisha/artisan schedule:run >> /dev/null 2>&1
Run Code Online (Sandbox Code Playgroud)
应用程序/软件/ 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
{
/**
* 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->command('inspire') …Run Code Online (Sandbox Code Playgroud)