In case you ran into this problem This page isn’t working www.example.com is currently unable to handle this request HTTP ERROR here is the cause and how to fix it. First, it must not be an error from your code, it is an error from querying large data from your database. So request ran out of memory, to fix it follow this step.
In your Laravel root project folder locate this file
vendor/laravel/framework/src/Illuminate/
Database/Connection.php.
Insert this line of code after line 324
ini_set('memory_limit', '-1');
or follow the code snippet or image below:
public function select($query, $bindings = [], $useReadPdo = true) { return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { if ($this->pretending()) { return []; } // For select statements, we'll simply execute the query and return an array // of the database result set. Each element in the array will be a single // row from the database table, and will either be an array or objects. ini_set('memory_limit', '-1');
$statement = $this->prepared($this->getPdoForSelect($useReadPdo) ->prepare($query)); $this->bindValues($statement, $this->prepareBindings($bindings)); $statement->execute(); return $statement->fetchAll(); }); }
Continue Reading
Be first to comment