Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes)

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:

Read More

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.

Related posts

Leave a Reply

3 comments

  1. 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.

  2. 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.

  3. 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.