6
votes

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
Does your new memory limit really work? How did you upgrade the memory limit? Checked phpinfo() after the change?Marcel
Yes, I've restarted the apache server and PHP see my new limit (134217728 bytes exhausted).lollo64
Which phpMyAdmin version?Marc Delisle
@MarcDelisle 5.5.33-cll-lvelollo64

5 Answers

2
votes

Don't use 128MB use 128M, seriously, try it.

2
votes

I realize this is an old question, but I started having the same issue today on Apache running on a Linode virtual server. In my case, the solution was simply to enable Zend Opcache. It was disabled due to an error in one of the ini files in '/etc/php5/apache2/conf.d/' directory.

I was getting intermittent errors, where most of the time pages and images would load just fine, but once in a while they would fail. Images would be broken and instead of seeing a page I would get "connection error".

These are some additional errors I was seeing in the Apache's error.log file:

[core:notice] [pid 8186] AH00052: child pid 9008 exit signal Segmentation fault (11)
[core:notice] [pid 8186] AH00052: child pid 9007 exit signal Aborted (6)
*** Error in `/usr/sbin/apache2': free(): invalid pointer: 0x00007f56840b63c0 ***

and of course the infamous:

[:error] [pid 8829] [client nnn.nnn.nnn.n:24471] PHP Fatal error:
  Allowed memory size of 134217728 bytes exhausted (tried to 
  allocate 94008222532912 bytes) in Unknown on line 0, referer:
  https://www.mysiteurlhere.com/node/page

After enabling zend opcache, there are no more errors in error.log, and everything works as it should.

1
votes

Do this in your php script,

ini_set('memory_limit', '-1');  // -1 here implies no limit, you can even set it to a bigger number like '192M' for 192Mb space.

This will override the default memory limit.

This question has already been answered many times.

0
votes

If changes for php.ini doesn't take affect for you, try to change phpmyadmin's config.inc.php. In most cases it locates at /etc/phpmyadmin. Insert rows bellow before ?> tag:

$cfg['ExecTimeLimit'] = 300000;
$cfg['MemoryLimit'] = -1;

You may set $cfg['MemoryLimit'] to 0. In that case the value will be taken from php.ini

0
votes

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));