Fix PHP Fatal error: Allowed memory size of 33554432 bytes exhausted

Fix PHP Fatal Error

Fix PHP Fatal Error

I just upgraded my wordpress version to 2.8.5 and then I got PHP Fatal Error problem. Also when I tried to upgrade the plugin, the error keeps on coming which prevent me from upgrading the plugins.

Example of the Error:
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 6233929 bytes) in /public_html/…/wp-includes/cache.php on line 330

To fix this PHP Fatal Error problem in WordPress I used the following trick. I am not sure that it will work on your but at least I found my solutions and would like to share with you all.

Step 1: Open the file wp-includes/cache.php and add the following code immediately after the opening <?php

ini_set(‘memory_limit’,'32M’); // set memory to prevent fatal errors

Step 2: create an htaccess file for the wp-includes directory and add the following code:

# set memory limit for cache.php
php_value memory_limit 32M

Step 3: Create php.ini file, add the following code and upload in the same directory (wp-includes):

;; set memory limit for cache.php
memory_limit = 32M

If necessary, you may try increasing the values for the memory limit.

If you have problem with editing these files then you can download the complete set I have customized for my site.
Click here to download.

Twitter Digg Delicious Stumbleupon Technorati Facebook

6 Responses to “Fix PHP Fatal error: Allowed memory size of 33554432 bytes exhausted”

  1. It worked in my website too. But I had similar error and it is fixed. This error happened when I tried to import the posts from my another blog. Here goes my error Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /wp-includes/kses.php(413) : runtime-created function on line 1. Thanks Sakin, you saved me.

    [Reply]

  2. Thanks Game Previews and Jas for your commenting…

    [Reply]

  3. Thank you. But it only worked after I increased the memory_limit = 64M .

    [Reply]

  4. Hmmm… I’m getting the same error, but even 64M isn’t working. I have no other plugins installed (Akismet is currently disabled). Apparently your hosting company can lock you down and not allow this fix? :(

    [Reply]

    sakin Reply:

    Hi Stephanie,

    You can increase it to 124M. You can increase the size to 125M. Make sure that you have made changes to all three files.

    Click Here to download the Pack with 125M.

    If this doesn’t solve your problem then can you email me what you get as an error message.

    Regards,
    sakin

    [Reply]

Leave a Reply