【问题标题】:Laravel "Maximum execution time of 60 seconds exceeded"Laravel“超过60秒的最大执行时间”
【发布时间】:2020-03-22 18:09:55
【问题描述】:

所以我尝试在 php.ini 中更改 max_execution_time=1800,但在我的“视图”中出现同样的错误

在我的 web.php 中

Route::get('/article', array('as' => 'accueil', function()
{
  $categories = \App\Categorie::latest()->get();
  $articles = \App\Article::select('id', 'title', 'intro_text')->orderBy('created_at', 'desc')->get();
  return view('accueil', ['categories' => $categories, 'articles' => $articles, 'actif' => 0]);  
}));

我认为这是返回视图的问题

【问题讨论】:

标签: php


【解决方案1】:

我添加了 set_time_limit(0) 并且它正在工作,就像这样

Route::get('/article', array('as' => 'accueil', function()
{
  $categories = \App\Categorie::latest()->get();
  $articles = \App\Article::select('id', 'title', 'intro_text')->orderBy('created_at', 'desc')->get();
set_time_limit(0);
  return view('accueil', ['categories' => $categories, 'articles' => $articles, 'actif' => 0]);  
}));

【讨论】:

    猜你喜欢
    • 2018-08-31
    • 1970-01-01
    • 1970-01-01
    • 2019-03-25
    • 2020-04-29
    • 2010-11-28
    • 2018-08-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多