Behind increasing, the WordPress PHP Memory limit could be several reasons. Some of them are HTTP error while uploading the image, white screen of death, and also 500 Internal server error, Fatal error: Allowed Memory size(Memory exhausted error) and more.
By default, WordPress comes with 32MB memory, which is quite low and needs to be increased for the obvious reasons. And doing so, it will certainly fix memory exhausted error in WordPress just like a magic.
We got plenty of reasons to increase WordPress PHP memory limit now, isn’t it? Let do it.
As we have several reasons to do so, we have several ways to do so. I will walk you through them in this tutorial.
What is PHP memory limit?
PHP memory_limits are as unique as highway speed limits. There can be an infinite number of lanes on a highway (parallel processes), just as there can be an infinite number of cars. PHP’s memory limit is the maximum amount of memory that can be allocated to one process. PHP processes are usually associated with specific page views.
Increase PHP Memory Limit through WP-Config in WordPress
It would be easier for you if you have ever edited your wp-config file before. If you haven’t this is the step by step guide for you. You need to access the root folders and files of your site. You can do it through the FTP server or even from your Control Panel. Here I will do it through the Control Panel.
Go to your Control Panel. It can be accessed by following similar link as below,
https://www.yourdomainname/cpanel, replace yourdomainname with your actual domain
Enter the Login credentials, After landing on the CPanel Dashboard. Look for File Manager and Click on it. You will see your site database and files over there.
To Access WP-Config file, look for “public_html” and click on that. You will find “wp-config” file over there, right-click on it and Edit it.
This will open a code editor, and find the line which will look alike, “That’s all, stop editing! Happy blogging“.
And paste the below code, just above it. Make sure you do it exactly the same!
define( 'WP_MEMORY_LIMIT', '256M' );
All you need to do now is to hit the Save Changes button. The above code defines WordPress to increase the memory limit to 256M, though you can increase or decrease that number. It all depends on how big your site is. But, if you don’t know what you are doing, leave it to 256M.
That’s’ it, doing you will be get rid of the memory exhausted error. Please share your thoughts if this helps in the comment section below.