Laravel内存大小问题

时间:2017-05-11 09:23:34

标签: php laravel-5

我收到此错误消息:

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

0 个答案:

没有答案