2017-01-03 22 views
0

請幫助我。 如何運行此命令:如何在瀏覽器中運行手工計劃?

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

在瀏覽器(example.com/runschedule)?

Laravel版本:5XX

我已經試過

Route::get('/runschedule', function() { 
    Artisan::call('schedule:run'); 
    return back()->with('status','Cron complete!'); 
}); 

,但它無法正常工作。該頁面顯示

(哎呦,看起來像出事了。)

+1

啓用錯誤報告並檢查出了什麼問題。 –

+0

當然你可以在瀏覽器上調用它。檢查你的laravel錯誤日誌。展示下。 –

回答

0

你指揮運行良好,而且很可能您的重定向迴應該工作,以及,你可能有如下問題:你的調度命令:

/** 
* Define the application's command schedule. 
* 
* @param \Illuminate\Console\Scheduling\Schedule $schedule 
* @return void 
*/ 
protected function schedule(Schedule $schedule) 
{ 
    // This is the scheduled command 

    $schedule->command('inspire')->hourly(); 
} 

當人們說到這裏,編輯.ENV文件並啓用調試APP_DEBUG=true,也看看你的日誌:storage/logs/laravel.log