PhpMyAdmin | Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate xxxxxx bytes) in Unknown on line 0

Viewed 16655

I'm tying to find the cause of this error but I'm failing. I've have installed PhpMyAdmin on my server and right now on the footer of every page I'm getting this error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10934248 bytes) in Unknown on line 0

As you can see I've tried di upgrade the memory_limit (from 2MB to 128MB) but I still getting this error. Right now it appears every time I login in PhpMyAdmin console, also if I don't do any opertation. Do you have any suggestion?

I've tried to follow some answer that I find on the web, but no one seems to resolve the problem. Also I can't find the file that throw the error becasue it's "Unknow" and I can't understand who is asking for such quantity of memory.

5 Answers

When the number of tables in the database became more than 9400, I faced the same problem.

The problem appeared only when I entered a query to the database using phpmyadmin. Some time later, after the beginning of the input query on the screen there was a 500 error and logs the error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10934248 bytes) in Unknown on line 0

The solution was to comment out part of the code in the db_sql_autocomplete.php , which is located in the phpmyadmin folder.

The code db_sql_autocomplete.php:

<?php
 
use PhpMyAdmin\Response;
require_once 'libraries/common.inc.php';

/*
if ($GLOBALS['cfg']['EnableAutocompleteForTablesAndColumns']) {
    $db = isset($_POST['db']) ? $_POST['db'] : $GLOBALS['db'];
    $sql_autocomplete = array();
    if ($db) {
        $tableNames = $GLOBALS['dbi']->getTables($db);
        foreach ($tableNames as $tableName) {
            $sql_autocomplete[$tableName] = $GLOBALS['dbi']->getColumns(
                $db, $tableName
            );
        }
    }
} else {*/
    $sql_autocomplete = true;
//}
$response = Response::getInstance();
$response->addJSON("tables", json_encode($sql_autocomplete));

Related