Chances are that you have come across ‘WordPress Memory Exhausted Error’ if you’re used to migrating or uploading files or installing plugins. This could happen even after the files have been moved. The error actually looks like this:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line xxx
If you’re greeted with such a page when you wanted to access your website, don’t panic because it’s something that can be resolved easily. That is what this post is set to help you achieve.
Why does this error come up? You might want to know why this error comes up on your site. In most cases, it’s not that you did something wrongly or edit code with syntax error. The error does come up when the default PHP memory limit set has been used up.
This happens when a poorly coded plugin is installed or a script has consumed the allocated memory. When these happen, there are steps you can take to correct the error.
Solution to resolving WordPress memory exhausted error
The solution is simply to increase the default PHP memory set for your website to something higher. Your web host can help you with this if you contact them and could even help you point out the script or plugin that is responsible for the consumption. But, it’s something you can do yourself.
How to increase PHP memory in WordPress
All you have to do is to locate WP-config.php file on the root directory of your web server. You can access this file either through FTP client like Filezilla or through File manager on cpanel. Open the file (WP-config.php) and insert the code below just after the <? php tag.
Save the file and you’re done. You can modify the value to suite your need or requirement.
Alternatively, you can use the notepad on your computer to create a file. Insert the code below in it and save the file as php.ini. Upload the file into the root directory of your website through FTP or file manager.
;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 30 max_input_time = 60 memory_limit = 128M
That’s all. These should fix WordPress memory exhausted error you get on your website.
Conclusion: This issue can happen anytime especially during plugin installation or file upload. Whatever may be the cause, now you know the solution.
However, it is expedient to dig deeper to know the cause of the error and remove the script or plugin by contacting your web host or check your server log if you have access to it so as to prevent future occurrence. What do you think?
- How to Add Post Thumbnail Image to RSS Feed on WordPress - February 16, 2016
- 10 Tips for Getting the Most out of Google Image Search - January 19, 2016
- How to Add Next and Previous Post Links with Thumbnail - January 11, 2016