简体   繁体   中英

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

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.

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.

不要使用128MB使用128M,严重的,试试吧。

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM