I have the following set up:
In routes I have:
Route::get(\'articles\', \'ArticlesController@index\');
The index method in the controller is simply:<
Add above query
ini_set("memory_limit", "10056M");
In Laravel:
Add set_time_limit(0) line on top of query.
set_time_limit(0);
$users = App\User::all();
It helps you in different large queries but you should need to improve query optimise.
set time limit in __construct method or you can set in your index controller also where you want to have large time limit.
public function __construct()
{
set_time_limit(8000000);
}
it's a pure PHP setting. The alternative is to increase the execution time limit only for specific php scripts, by inserting on top of that php file, the following:
ini_set('max_execution_time', 180); //3 minutes
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
If you are hosting your Laravel app on Heroku, you can create custom_php.ini
in the root of your project and simply add max_execution_time = 60