I believe we all have encountered errors while using WordPress. Some of them can be fixed by a fresh install or updating. But there are some that need some editing in the PHP code to get fixed. One of them is the Memory Exhausted Error, which usually happened when you try to upload media on WordPress. Since all of your sites are hosted on servers and servers need some memory limit to run efficiently, you are bound to face memory limit errors.
Most of the new users have might get the wrong idea and they try to limit their media size. Which once again, when pilled up start showing the same error again. So the best way to get rid of this issue is to Increase PHP Memory size. You can do that by downloading the wp-config.php file using any FTP client. Then edit the file and upload the file. And if you have no idea what I am talking about, follow the guide below to learn it.
WordPress Memory Exhausted Error?
As I said, that web servers need memory to run apps efficiently. And much like any other computer if they run out of memory they start giving errors. Though the good thing is that they can tell you about the error. And thus you can solve it easily, unlike most other apps that won’t even tell you about the errors.
When your WordPress requires more memory, it will generate an error like this. The code line might be different, but the rest of the stuff will be the same.
By default, the memory set by WP is 64MB, which is enough in most cases. But sometimes, you’ll have to increase it so you can run more stuff smoothly. Now, let’s see how we can increase PHP memory size and get rid of this error once and for all.
How to Increase PHP Memory Limit?
You’ll need to edit the wp-config.php file. For that, you’ll need an FTP client to access it. You can also use the file manager in your cPanel to access that file, whichever option you’ll find good, you can go for it.
Now copy and paste the following line in that file, right before the line that says ‘That’s all, stop editing! Happy blogging’.
1 define( 'WP_MEMORY_LIMIT', '256M' );
That way you’ll increase the memory limit to 256MB, now save the file. And re-upload it to your sever. Now visit your site again and the memory error will be gone.
Note: If this solution doesn’t work for you or you can’t able to increase your PHP limit. You can ask your web hosting service to do that for you. Cuz sometimes they limit this size themselves and won’t allow the users to modify it.