Fatal error: Allowed memory size of 33554432 bytes exhausted

This error can be quite alarming for you WordPress users out there who’ve just encountered it for the very first time. It’s one of those errors that tends to just show up without warning – usually preventing you from accessing your blog altogether.

I just had this happen to me on one of my blogs, so I figured I’d take a second to share the solution to this problem for those of you who may be experiencing it.ย If you’ve arrived at this page looking for a solution to this problem, well you’re in luck. The fix is actually pretty easy, provided you’re comfortable with using an FTP client or your hosting account’s file manager.

WordPress gives you this fatal error message when it needs to tell you that its exhausted its available PHP memory limit. To fix it, all we need to do is increase the allowable memory for running PHP scripts.

To increase the default WordPress PHP memory limit:

WordPress php.ini file
  • Save
WordPress php.ini file
  1. Locate your WordPress site’s php.ini file, which is in your blog’s directory. (public_html/ or public_html/blog/)
  2. Download it to your computer and change the name of the file to php.ini.txt (if necessary), then open the php.ini file in a text editor such as Notepad or TextEdit.
  3. Search through the file until you locate the section called “Resource Limits”. (Use CTRL+F or CMD+F and search for 32M)
  4. Change the available PHP memory limit from 32M to 64M. (If this still doesn’t cut it, you can try changing it to 96M, but 64M should do the trick)
  5. Rename the file back to php.ini and upload it to your server – rewriting the existing one.
Increase the Resource Limits in the WordPress php.ini file
  • Save
Increase the Resource Limit from 32M to 64M

This little fix should get you out of the woods. Doubling the resource limits in the php.ini file should be enough to allow WordPress enough available PHP memory to do what it needs to do.

I’ve had to use it a few times over the years and it always works like a charm. ๐Ÿ™‚

Alternative fix: Edit your WordPress config.php file

Another method you can try is to increase the memory limit in your WordPress config.php file. This is a decent workaround, if for instance, your server won’t allow you access to your blog’s php.ini file.

Download your WordPress config.php file to your computer, open the file in a text or html editor, and add the line:

define('WP_MEMORY_LIMIT', '64M');
WordPress config.php memory limit
  • Save
Add the line of code to your blog's config.php file

Upload it to your server – overwriting the existing config.php file. There, now that’s another solution you can try.

I hope that either of these fixes solves your problem. Good luck! ๐Ÿ˜€

Leave a Comment

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