Fatal Error PHP won't seem to go away [duplicate] - php

I'm getting an error when I try to open one of my dashboard pages in my wordpress script
The error message is as follows:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried
to allocate 71 bytes) in
/home/admin/domains/filesick.com/public_html/wp-includes/taxonomy.php
on line 2685
I asked around and was told I have to increase the memory_limit to something higher than 256M, so I changed it to 512M and still the same problem. Then I changed it to 3024M and this is what I have now, but that didn't fix the problem.
So could you please tell me how to fix this and what should I do?
Waiting for your response.

WordPress overrides PHP's memory limit to 256M, with the assumption that whatever it was set to before is going to be too low to render the dashboard. You can override this by defining WP_MAX_MEMORY_LIMIT in wp-config.php:
define( 'WP_MAX_MEMORY_LIMIT' , '512M' );
I agree with DanFromGermany, 256M is really a lot of memory for rendering a dashboard page. Changing the memory limit is really putting a bandage on the problem.

I had this problem. I searched the internet, took all advices, changes configurations, but the problem is still there. Finally with the help of the server administrator, he found that the problem lies in MySQL database column definition. one of the columns in the a table was assigned to 'Longtext' which leads to allocate 4,294,967,295 bites of memory. It seems working OK if you don't use MySqli prepare statement, but once you use prepare statement, it tries to allocate that amount of memory. I changed the column type to Mediumtext which needs 16,777,215 bites of memory space. The problem is gone. Hope this help.

I changed the memory limit from .htaccess and this problem got resolved.
I was trying to scan my website from one of the antivirus plugin and there I was getting this problem. I increased memory by pasting this in my .htaccess file in Wordpress folder:
php_value memory_limit 512M
After scan was over, I removed this line to make the size as it was before.

Related

Prestashop: Out of Memory (allocated ...) in ../../../classes/Configuration.php

Prestashop suddenly gives an http 500 error. I turned on error log and got this:
"Fatal error: Out of memory (allocated 709623808) (tried to allocate
130968 bytes) in
/var/www/vhosts/44/252639/webspace/httpdocs/shop.mywebsite.com/classes/Configuration.php
on line 206".
I double checked the Configuration.php on line 206 and it's just a standard prestashop file, nothing weird in it. After all it's an "Out of memory" error so maybe I should increase memory.
phpinfo() shows memory_limit 1024M, which is already pretty much, but maybe I should try 2048M. I tried to create a new custom php.ini but that did not work, because (according to phpinfo) the loaded ini file is searched in this directory: /opt/alt/php56/etc.
My hosting provider does not allow me to edit it, it's read only.
What could I do to solve the problem ?
I did not make a backup yet.
I fixed it. It had nothing to do with not having enough memory or whatever. Someone created a product and that caused errors, I don't know what exactly but for everyone in the future:
Create a backup
Turn off third party modules
Delete all products
Delete cache
etc etc. until your webpage loads correctly again ->
after that, restore your backup and just delete what caused the error.
Hope it will work.

Fatal error in WordPress, "Allowed memory size of X bytes exhausted"

I am a WordPress beginner and I have only rudimentary knowledge about CSS and HTML. I have built a WordPress blog in the last days, and it was working well. But since two days I couldn't login and couldn't open the page (but I haven't touch the page since about one week, I don't know what happened). This is what was shown:
Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 30720 bytes) in /home/u0087038969/public_html/wp-admin/includes/deprecated.php on line 533
I suggested that one of the installed plugins caused this trouble. That's why I changed the name of the plugin file via FileZilla, so that I get access to WordPress again. Then I tried to reactivate the plugins gradually to find the trouble-maker. Still it's not really working. What can I do to go about solving the problem?
p.s. I used the following wp plugins: mail poet, all in one seo and contact form 7.
The problem is your installation is requiring more memory than you have available for your site. If you are using a shared hosting environment, you might be at a loss in increasing your memory allotment.
Try updating your wp-config file:
define('WP_MEMORY_LIMIT', '256MB');
If you can change your PHP.ini file you can adjust this:
php_value memory_limit 256MB
Your host seems to have this set incredibly low if it's giving you a memory error at 50MB.

Wordpress Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in /wp-includes/meta.php on line 837

I am new in wordpress. i am getting below error.
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried
to allocate 72 bytes) in
/wp-includes/meta.php on line 837
while accessing new post page. and also i have added below code in htaccess file.
<IfModule mod_php5.c>
php_value memory_limit 512M
</IfModule>
Please help me to sort out this issue.
Try adding this line to your wp-config.php file:
define('WP_MEMORY_LIMIT', '64M');
If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
If you don't have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M
Talk to your host.
In my case deleting old wordpress post revisions helped. Also you can restrict the amount of revision per article or disable it altogether.
Here's how I did it: Limit or Disable and clean up old wordPress revisions
Debug your WordPress installation with these Basic WordPress Debugging Techniques.
I found many WordPress themes showing this error due to a wildcard searching all through the database. If possible, control the query's posts_per_page from -1 to something reasonable.
And the increment in Memory Limit is sometime a temporary solution if your code is buggy, or giving enormous load to your system that your system is not prepare in handling.
Changing the memory limit is usually only masking the real problem, unless you have it set to some really low value. The problem itself is usually hard to pinpoint.
In my case the problem was caused by someone that set the number of posts per page to some absurdly high value like 999 in my case:
When I found it the solution was easy - I just decreased it to something reasonable like 100.

wordpress - memory limit exhausted due to number of posts

I have installed wordpress on my client's server . The website has 10,0000 posts .
When I had less number of posts, there was no issue but now is throws this error
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 35 bytes) in /home/content/22/11685822/html/wp-includes/taxonomy.php on line 2790
I tried adding the below in my php.ini file ,
memory_limit = 64M ;
still does not seem to solve the problem .
Kindly help.
try defining max memory in wp_config like this : define( 'WP_MEMORY_LIMIT', '96M' );
First open your wp-config.php which is located in the root WordPress directory. Then add the following line inside the main php tag:
define('WP_MEMORY_LIMIT', '64M');
I had faced same problem when I had used custom taxonomy. The cause of my problem I
did recusive call to post_tags_meta_box function (responisible for default tag feature add/update function). If you increase memory limit it does not solve your problem.
Cause of the problem might be leak in your code, or possibly an infinite loop.
So I would sugegst to try to figure out the problem instead of increase the memory size.

memory limit in php

I'm making a curl request , witch was working perfectly for weeks, and now it's returning this error:
Allowed memory size of 262144 bytes exhausted (tried to allocate 76889 bytes)
The weird part is that i've checked php.ini and phpinfo and both tell me memory limit is
memory_limit 1028M
I've also tried
ini_set("memory_limit","400M");
In the top of the file to make sure, but still, getting this error.
This is happening in both development and production servers.
DaveRandom nailed it. suhosin (I wasn't even aware we had that
installed) was causing de issue by "overprotecting" the server.
[forums.cpanel.net/f5/php-memory-limit-problem-69715.html][1] - TL;DR
it's being caused by suhosin. – DaveRandom
Thanks to all!
[1]: http://forums.cpanel.net/f5/php-memory-limit-problem-69715.html
UPS, that somehow fiexd the error in that part, but another part of the webapp is throwing same error.
I have no clue where to look at.
it says memory limit is 1028M in php info, if i change it via ini_set, new value appears using ini_get, and now I have set suhosin to simulation. that somehow fixed the first problem, but now it reappeared.

Categories