0

So I've tried to change max_execution_time=1800 in php.ini but it's the same error in my "view"

in my 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]);  
}));

I think that's a problem of return view

  • Maybe help you - https://stackoverflow.com/questions/5140258/increase-php-script-execution-time – Dmitry Leiko Nov 27 '19 at 08:27
  • Possible duplicate of [Fatal error: Maximum execution time of 30 seconds exceeded](https://stackoverflow.com/questions/5164930/fatal-error-maximum-execution-time-of-30-seconds-exceeded) – Cas Nov 27 '19 at 10:48
  • did you restart your web server after change in php.ini file? – Behzad Dadashpour Nov 27 '19 at 11:44

1 Answers1

0

I added set_time_limit(0) and it's working, like this

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]);  
}));