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.
The correct way is to edit your php. ini file. Edit memory_limit to your desire value. As from your question, 128M (which is the default limit) has been exceeded, so there is something seriously wrong with your code as it should not take that much.
This usually happens when hosting a high-traffic and big websites using small shared hosting servers, which allocate very little amounts of PHP memory per each hosting plan. To fix the error, you have to manually increase the default PHP memory limit set for your server.
Simple — increase the memory limit programmatically early on in your code, before your process runs out of memory. If you do it this way, you can give PHP extra memory only when that piece of code gets called rather than increasing the memory limit for all PHP processes.
Don't use 128MB use 128M, seriously, try it.
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 you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With