WordPress Php Memory Error

WordPress – Fatal Error: Allowed Memory Size Of 33554432 Bytes Exhausted

Receive “Fatal error: Allowed memory size of 33554432 bytes exhausted” when try to upload an image with medium file size. To solve this error, try to increase the memory allocated to PHP. You can set the limit to 32MB, 64MB, 128MB or 256MB. It depends on your host.

Solution 1: Edit PHP.Ini

If you’re still allowed to edit your PHP.inifile, update your memory_limit in PHP.ini by modifying the below line

memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

If the line is showing 64M in default, try 128M.

Solution 2: Edit .Htaccess File

Add the script below to your .htaccess file.

php_value memory_limit 64M

Solution 3: Edit Wp-Config.Php File

Add the script below to your wp-config.php file

Increasing memory allocated to PHP
define(‘WP_MEMORY_LIMIT’, ’64M’);

Madu coding

What i wonder, What i did, What i learned

  • July 2016 (1)
  • June 2016 (1)
  • March 2016 (1)
  • January 2016 (3)
  • December 2015 (4)
  • November 2015 (4)

Recent Posts

Categories

Hi I’m Udara Madushan

I m a Software Engineer working at Maya Creations (PVT) Ltd, and the husband of lovely wife Lankshani. I love learning new things.

Tag: PHP: Fatal Error

Fixing Allowed Memory Size Exhausted Fatal Error on Your WordPress Site

Have you ever got this PHP error while you are working with your WordPress site?

PHP: Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted………………………….

This kinda memory error may one of the most common and hard-to-fix problem that you are frustrating. In most cases, this error comes from loading more into memory than what you set up PHP to handle in one process.
Examples :

PHP: Fatal Error: Allowed Memory Size of 8388608 Bytes Exhausted
You have set 8 MB and its not enough.

PHP: Fatal Error: Allowed Memory Size of 16777216 Bytes Exhausted
You have set 16 MB and its not enough.

PHP: Fatal Error: Allowed Memory Size of 33554432 Bytes Exhausted
You have set 32 MB and its not enough.

PHP: Fatal Error: Allowed Memory Size of 67108864 Bytes Exhausted
You have set 62 MB and its not enough.

PHP: Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted
You have set 128 MB and its not enough.

PHP: Fatal Error: Allowed Memory Size of 268435456 Bytes Exhausted
You have set 256 MB and its not enough.

PHP: Fatal Error: Allowed Memory Size of 536870912 Bytes Exhausted
You have set 512 MB and its not enough.

PHP: Fatal Error: Allowed Memory Size of 1073741824 Bytes Exhausted
You have set 1024 MB(1BG) and its not enough.

But in very rare cases, It happens since the memory leak, if you are on PHP 5.3 and above.

Here are the solutions for your WordPress site. (Suppose we have set 32MB the memory limit.) You can increase your memory allocated size using following ways.

Increase PHP Memory using wp-config.php file

Add bellow line to your wp-config file.

If Setting 64MB does not solve our problem, We can increase it by adding 96M and more.

Increase PHP Memory using php.ini file

We can use our FTP access or hosting access and then find php.ini file and then edit the memory_limit. If 64M doesn’t work then we can further increase to 96M or more.

Increase PHP Memory using .htaccess file

We can edit our .htaccess file which is located on the root directory of the WordPress installation by adding following line.

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

Updated: 11 June 2014. Published: 22 October 2009

Fix PHP Fatal Error

I just upgraded my WordPress 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, you can use following tricks.

Increasing memory allocated to PHP

Many times you will get this error due memory size allocated for PHP less then needed. Please note, this setting may not work if your host does not allow for increasing the PHP memory limit–in that event, contact your host to increase the PHP memory limit.
Increase PHP Memory using wp-config.php file
Use your FTP access or hosting access and then find wp-config.php file in your WordPress installation root directory and then add the following code in your wp-config.php file. If 64M doesn’t work then you can further increase to 96M or more.

Increase PHP Memory using php.ini file
Use your FTP access or hosting access and then find php.ini file and then edit the memory_limit. If 64M doesn’t work then you can further increase to 96M or more.

Increase PHP Memory using .htaccess file
Use your FTP access or hosting access and then find .htaccess file in your WordPress installation root directory and the add the following code. If 64M doesn’t work then you can further increase to 96M or more.

If the above option doesn’t work then try the following steps

Step 1: Open the file wp-includes/cache.php and add the following code immediately after the opening This entry was posted in WordPress and tagged IT Tips & Tricks, wordpress by sakinshrestha. Bookmark the permalink.

21 Replies to “Fix PHP Fatal error: Allowed memory size of 33554432 bytes exhausted”

Thanks men 🙂 it works

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.

Thanks Game Previews and Jas for your commenting…

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

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? 🙁

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.

After a long and constant search I found the file set and it worked for me.
Thanks a lot.
🙂
—Imran

Hello there!
Unfor I cant download the pack.
How exactly do i creat a htaccess file please?

Thanx for the help

Hi firelilly,
Thanks for the comment. I have updated the download link and not you can download it.
Regards,
Sakin

Hey mate,
The download links still don’t work that are listed on this page.

It is working. I have also emailed you the file

Thanks, the .htaccess option works for me fine!

Thank you, thank you, thank you!!

Hi, I guess your solution seems to be working for a few people, have the same problem but I can’t download the pack. Any chance I can get it by e-mail. That would be very appreciated.

Nevermind… I tried the link again, it’s up. This is a life saver, it worked 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *