我收到此错误消息:
Allowed memory size of 268435456 bytes exhausted (tried to allocate 4194312 bytes) in /...../vendor/illuminate/database/Connection.php:347
这是找到第347行的函数:
public function select($query, $bindings = [], $useReadPdo = true)
{
return $this->run($query, $bindings, function ($me, $query, $bindings) use ($useReadPdo) {
if ($me->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.
$statement = $this->getPdoForSelect($useReadPdo)->prepare($query);
$statement->execute($me->prepareBindings($bindings));
$fetchMode = $me->getFetchMode();
$fetchArgument = $me->getFetchArgument();
$fetchConstructorArgument = $me->getFetchConstructorArgument();
if ($fetchMode === PDO::FETCH_CLASS && ! isset($fetchArgument)) {
$fetchArgument = 'StdClass';
$fetchConstructorArgument = null;
}
return isset($fetchArgument)
? $statement->fetchAll($fetchMode, $fetchArgument, $fetchConstructorArgument)
: $statement->fetchAll($fetchMode);
});
}
这是随机发生的,因此很难调试。有没有解决这个问题?我该怎么办? THX