Community Discussion

WordPress Fatal error: Out of memory - SOLVED

September 20, 2018
anwebservices Author Level X5

Write the reason you're deleting this FAQ

Lately many WordPress users had problem with uploading media files to their WordPress websites and i also was in same position for number of my websites. At first solution to fix "Fatal error: Out of memory" sounded easy, but after trying numerous things i finally solved my problem, and if you ever need this for your website, here is things you could do:

Error usually show up as HTTP Error when you uploading your media files (images) and you just see not embedable blank file in your media library, or if you go other way around to upload your images, you may get error like this:

Fatal error: Out of memory (allocated 36175872) (tried to allocate 30720 bytes) in /home/XXXX/public_html/wp-includes/class-simplepie.php on line 14272

Fatal error: Out of memory (allocated 35127296) (tried to allocate 1966080 bytes) in /home/XXXX/public_html/wp-includes/class-simplepie.php on line 5427


To solve this problem, there is few solutions you can do, but first you should try this:
  • Add following line to the top of wp-config.php
define('WP_MEMORY_LIMIT', '256M');
 

In most cases this would solve your problem, but for me it didn't work so i had to go one step further and after two days of searching for another solution i finally find this, so if you need it ever, here you go:

1. Use your FTP software (or enter trough cPanel) to edit your .htaccess file.
2. Add following code to your .htaccess as separate line:
RLimitMEM max


This was only solution which worked for me to avoid all errors and thankfully being able to upload all media files without problem again to my WordPress websites. So if you ever need it, there you go, or if you not sure how to do this, feel free to hire some coder from our marketplace.
20

Comments 20

September 21, 2018
Martinsx1
Good job and making everything possible to take care of this problem. Most people wouldn't know where to start from and would be confused to know what to do. I can remember when I had an issue with my Google Chrome connection failure to pages, it took me a while before I could fix it. But here, you have already made it easier for anyone else to take care of such problems when they experience it.

Enter a reason for deleting this comment

stbrians
SEOclerks happen to have professionals who are eager to help out with issues. Thank you for making this easier for most of us. I wouldn't know what to do in such situations

Enter a reason for deleting this comment

September 22, 2018
vhinz
Thanks for sharing this solution. I wouldn't be searching for long in the internet if the same problem will occur in my website.

Enter a reason for deleting this comment

stbrians
@anwebservices You were of much help. At least most of us have benefitted.

Enter a reason for deleting this comment

NesMarcos
This is indeed a big help and a worth sharing article. I am pretty sure there are a lot who are also experiencing the same problems like ours. I experienced the same failure many times and finally you have shared an easier solution to do. Kudos!

Enter a reason for deleting this comment

stbrians
He did work smart on it. We are indebted to him for writing about it. Quite timely indeed.

Enter a reason for deleting this comment

centurion
Very much nice tips and tricks. Every word press user face this types of troubles while any body have the word press based website. This is a programmatic solution for fatal error. Is there any word press plug in which will identify this types of problems and will solve the problem by own self. That will be very much beautiful matter if there have any plug in.

.htaccess file access from FTP is the most likely solution to me.
I hope it will works.

Thanks
Centurion

Enter a reason for deleting this comment

stbrians
I also wish there was a way it will solve by itself. However, there seem to be no such self solving method.

Enter a reason for deleting this comment

September 23, 2018
mark8625
Your post is really a big help. It is very informative. I would glad that you found this kind of solution that is really helpful. This is not easy am sure but you did it.

Enter a reason for deleting this comment

September 24, 2018
mitan143
Cool. That's really a life saver for somebody who's currently using wordpress. I'll take it down for future use. Well, I hope the developer would fix it already, so it would be nice and convenient when I'm already using wordpress. Then, I wouldn't be bothering anymore for that specific process. But I guess you should be aware of programming codes when you do that because if you are not so sure then you might be adding another errors to what you have already.

Enter a reason for deleting this comment

September 26, 2018
stbrians
Errors and glitches do happen online and can be stressful if you do not know how to fix them. It is good you knew how to fix this and shared it. We now know how to fix this though it has not happened to me.

Enter a reason for deleting this comment

September 28, 2018
beerthooyah
It really pays to have basic programming skills like html, c++ etc. There are many tutorials in the web on how to learn the basic coding for web design. If we really want to pursue an internet business we must take time to learn these all important skills in programming.

Enter a reason for deleting this comment

October 1, 2018
romyter013
Wow this is really worth help for us. We can use this steps in case it will happen or encounter the same message. We must master this I guess if we really decided to pushed our online business. Though we may not used it for now but I know for sure in the future this will be very helpful. Thank you for sharing this us.

Enter a reason for deleting this comment

October 2, 2018
jayjaydimson
Check your Internet or try to search the error messages on google.com, you'll probably see the solution on how to fix your concern.

Enter a reason for deleting this comment

October 6, 2018
Gilgamesh
Thank you for your concern into us that we may have future problems upon of what you have solved. We appreciate it into the fullest extent just keep up the good work in making tips and tricks that will make us to do things a lot easier.

Enter a reason for deleting this comment

October 10, 2018
theresajane
This is great, I am definitely putting this in my bookmarks. Thank you for giving us a very necessary information that we can use in the future. Surely, I would turn into this thread if ever I encounter the same problem.

Enter a reason for deleting this comment

February 7, 2019
cbrendlinger
You totally saved me. I cannot thank you enough for posting this solution. The first step failed for me, like it did for you, but the second worked like a charm. I update .htaccess and the error was resolved. Thank you!

Enter a reason for deleting this comment

August 30, 2021
totolh
I'll try with my website. Greate tips!!!

Enter a reason for deleting this comment

Please login or sign up to leave a commentJoin