How to solve a timeout error in Laravel 5

后端 未结 13 2200
说谎
说谎 2020-11-30 08:43

I have the following set up:

In routes I have:

Route::get(\'articles\', \'ArticlesController@index\');

The index method in the controller is simply:<

13条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 08:56

    try

    ini_set('max_execution_time', $time);
    $articles = Article::all();
    

    where $time is in seconds, set it to 0 for no time. make sure to make it 60 back after your function finish

提交回复
热议问题