Among the common WordPress errors is the memory-exhausted error. However,it is easier to fix this error by increasing the PHP limit in your WordPress.
Are you experiencing this error in your WordPress website? This article will explain to you how to fix the error through increase of PHP memory.
Please note that if you want to get professional help with this problem on your WordPress site,contact us here: Contact Helpbot
Before we get to guide,let us start by understanding this error.
What Is A WordPress Memory Exhausted Error?
WordPress is written in PHP programming language,a server-side language. For effective functioning of each website,it requires a WordPress hosting server.
Similar to computers,web servers require memory for simultaneous running of many apps in an effective manner. However,server administrators give defined memory size to various apps,which includes PHP.
You receive this error whenever your WordPress code needs more memory than the given memory.
Therefore,WordPress memory exhausted error is a standard error that occurs in any website,if the given memory limit to a code or script is less than needed memory. If the PHP memory is less than 64MB,WordPress works naturally to expand the memory. Nonetheless,64MB is in most cases not sufficient.
Often,most website owners experience this error if they have many apps,theme or plugins files operating simultaneously on their blog.
How To Fix A WordPress Memory Exhausted Error
Method 1 – Using FTP
This method needs you to implement changes on your WordPress website files. In addition,you should backup your website before you start this process. Here is how to fix this error using FTP client:
Step 1 – Find Your wp-config.php File
Among the core WordPress files is wp-config.php. This file stores vital information regarding your website settings. Your website cannot function without this file. Furthermore,to increase the allocated memory to your site,you need to edit this file.
You should use FTP (File Transfer Protocol) like FileZilla to edit wp-config.php. FileZilla is ideal for use as it is an open-source tool and it is compatible with all main Operating Systems.
You need a particular set of credentials to connect to your site through FTP. To login to your FileZilla,enter your username and password. Once it establishes connection,you will see some folders in the lower-right side.
Click on the public_html folder. It is the root folder of your WordPress,storing all files of your site. Find the wp-config.php file in this folder.
The public_html has many folders and files. However,you should avoid making changes if you are uncertain about the changes.
Step 2 – Edit The wp-config.php File
The FTP client allows you to implement changes on your website files. Right-click on your wp-config.php file,and then choose the View/Edit option to start editing. In turn,this option downloads a copy of your wp-config.php file,and opens it through your default text editor.
Although this copy contains any codes,it should not concern you,as you just need to add this line of code:
define( ‘WP_MEMORY_LIMIT’,’256M’ );
Paste this code before the line reading “That’s all,stop editing! Happy blogging.” It instructs WordPress to increase your PHP memory limit to the stated size. For example,the line above states 256MB.
After that,save your changes and then close the editor. As a result,FileZilla will ask if you would like to substitute the file version in your server with the edited one. Answer “Yes” for your edited wp-config.php file to upload back on your server.
Now,visit your WordPress site to check if the WordPress memory exhausted error is gone. This method should fix the error. However,if the error still exists,then it means your hosting provider prohibits manual increase of PHP memory limit. In such a case,you should contact them for assistance.
If this is getting a bit to technical for you,reach out to us on Social Media,and we’ll get back to you ASAP.
Method 2 – Using The Command Line To Fix The Memory Exhausted Error
An alternative method to the famous FTP solution. Besides that,only a few users apply this method. Although FTP is an important option for implementing changes on your website files,it is not effective like the use of a command line.
If you use Windows,click on the Start menu >> type cmd >> click Enter to see the command line. You will see a black box in your command line,which allows you to instruct your computer.
Although different systems have different commands,each OS allows you to implement changes on it through the command line. Likewise,you can access your site and edit the wp-config.php file through a series of commands.
In comparison to use of FTP,this process is faster. However,many shared hosting providers lack SSH (Secure Shell Access),a connection that you need to instruct your server through command line. If you have a Virtual Private Server (VPS) or any plan that allows you to have complete access to your server,then you can use the command line.
For a SSH connection,you need to use a client such as FTP. However,it is advisable to use Hostinger,as it does not have limitations,and it supports SSH connections for shared plans.
Once you login to your Hostinger panel,go to Advanced section>>SSH Access tab>>SSH Access Information. Here,choose your connection type as SSH,and then click the Enter button.
In turn,a command line shows up,requesting your username and password. Once you login,it is easier to edit your wp-config.php file. A single command is enough to find and open this file in your WordPress root directory.
Once your editor opens the wp-config.php file,add this text like in method one:
define( ‘WP_MEMORY_LIMIT’,’256M’ );
Ensure you add this line before the line saying “That’s all,stop editing! Happy blogging.” Once you are done,close your editor,and save the changes. Remember to visit your website to check if the error is gone.
In some cases,the command line does not take you directly to your WordPress root folder. Thus,you need to find it by yourself. To know if you landed on the root folder,you need to type Is in the command line.
This should show WordPress folders like wp-content and wp-admin. If this is not the case,go manually to the folder.
For effective functioning of any website,it needs a web-hosting provider and many resources to run. However,the more memory your website gets,the better it performs.
If you have any questions about how to fix a WordPress memory exhausted error,please reach out to us at this link: More details here