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:
- Locate your WordPress site’s php.ini file, which is in your blog’s directory. (public_html/ or public_html/blog/)
- 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.
- Search through the file until you locate the section called “Resource Limits”. (Use CTRL+F or CMD+F and search for 32M)
- 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)
- Rename the file back to php.ini and upload it to your server – rewriting the existing one.
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:
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! 😀