Nothing more boils up than witnessing an error. Being inhabitual in handling errors in WordPress, such as Exhausted Error, 404 Error and 500 Internal Server Error, then tighten your laces and get ready.  These errors should be handled carefully and tactfully. The programming of WordPress is executed in PHP. Many ongoing users who have quite recently converted PSD to WordPress will be unaware of some unique highlights of this platform. WordPress hosting server is required by each website for proper functionality.  

Web servers and computers are just the same. Both require memory and server to effectively run different applications at the same time.  Sometimes, server administrations appoint definite memory size to distinctive applications including PHP. So, when the WordPress code necessities more memory than the default one then, this error will pop up.

WordPress Fatal Error

These errors should be fixed on a prior basis otherwise it might lead to an unacceptable situation. WP memory exhausted error is one of the common errors which is faced by many website owners. Because of the more memory required by WP code than the allocated one.  

This article explains the probable ways of resolving the WordPress Memory exhausted error. The error can be fixed by FTP and by using the command line. Before jumping, it is required to consider the fact that with the mentioned ways, changes in the WP website are probable. Taking a backup of the recent files is also mandatory.  Each 000Webhost website has All-in-One-WP MIgration Plug-in within the set-up that can create a back-up in some minutes. So, let’s get started with the initial step:

Fixing the memory exhausted error using FTP (3 Simple Steps)

Step 1:  Locating wp-config.php File

Wp-config.php is a WP core file. It contains the information of the website setting and without this setting, the platform will not work.  From this file, the memory amount can also be increased.

File Transfer Protocol (FTP) is used to pull this off to transfer, receive and edit the file from the server with the client. For the ease, FileZilla can be used because of compatibility with Operating systems. While connecting the site with FTP, an appropriate setting is required. The user that can have 000Webhost users can discover it by logging in the dashboard by navigating from Settings⇒ General. FTP details will pop up then.

Locating wp-config.php File

As shown in the figure above, there are three fields, such as HostName, User name, and Password. From the FileZilla, three options, such as User name, Password, and Quick connect will appear. A user can fill these details and the port field should be left blank. Then, click on the Quick connect button to proceed further.

Locating wp-config.php File

After the establishment of the connection, from the lower-right quadrant, some folders will pop up. Double click on public_html as a WP root folder in which each platform file is placed. Wp-confid.php file is in the folder as depicted below:

Locating wp-config.php File

Step 2: wp-config.php FIle Editing

For editing the wp-config.php file, choose the Edit/View option by right-clicking on it. It lets user to download a file-copy and can be opened by a local default text editor. After analyzing the code, a user can add a single code line to the wp-config.php file;

wp-config.php FIle Editing

The code could be used anywhere before the line that reads “ / * That’s all, Stop Editing! Happy Blogging,*/   at the end of the file. The memory space is now increased from 68 to 128 MB. This much of memory is sufficient for several websites.   After adding that line to the wp-config.php file, close the editor after making the changes. There would be a question from Filezilla that will enquire to replace the file version on the server with one editing, for that a user should answer, ‘Yes’.

Before moving on, a user can ask the server to increase the memory allocation through WordPress through .htaccess and php.ini files.

Step 3: Assure that the Error has disappeared

A user should check that the error has gone except a condition when a web host will not enable to increase the memory limit manually. If the error is persisted with a novel memory amount number then there is a requirement to increase that number,

As of now, a user has become familiar with how to fix the WordPress Memory exhausted error.  Though, there is more ways to fix it which might be significant for some users.

Fixing the memory exhausted error using Command Line

Nevertheless, FTP is a convenient option to follow for making changes to the website. But, it is not effective as Command line.  If the user is not familiar with the command line. Then by clicking on the start menu, by typing cmd, a black box will appear as shown below. Each Operating system enables for making any changes to it with the command line. Though, the commands may vary as per the system. A user can access the websites and can draw the changes to the wp-config.php file with some commands. This process is faster than FTP.

Fixing the memory exhausted error using Command Line

It is forbidden that the shared hosting plans do not authorize with Secure Shell Access (SSH).  it is the type of connection that provides the server guidelines form the command line. So, it is preferable to use Virtual Private Server (VPS) that can assist in providing full access to the file.

So, for connection establishment from SSH, a client is required as FTP.  For a window user, PuTTy is the best option. After installing and executing the program, some details will be asked for a connection to the website.

Fixing the memory exhausted error using Command Line

Being a free 000Webhost user, direct connectivity with SSH to the website is not possible. So, to follow the FTP option is the best solution.  Though, such issues are not faced by Hostinger users. So, for discovering the details, the user should log in to the Hostinger control panel. From the advanced section, SSH access tab can be accessed:

Fixing the memory exhausted error using Command Line

Within this, discover the SSH Access information tab. SSH Port and SSH IP are now required to enter into the PuTTy. Connection with SSH should be established. A command line that demands username and password will pop up:

Fixing the memory exhausted error using Command Line

A user will get full access to the information after filling all the credentials from the command line.

Because the user is accessing the command line, so there is no need to get into hoops for editing the wp-config.php file. All are required to type a single command for locating and opening.

If a user is located in a WP root directory, like,

wp-config.php file

The command mentioned above will execute the wp-config.php file with the nano editor. It works in the command line. A user can navigate within using the arrow keys by adding a normal text.  Do not forget to add the below code:

wp-config.php memory limit

Before the line that reads “ / * That’ all, Stop Editing! Happy Blogging, */. Press Ctrl +X to close the Nano editor. When asked to save the changes, Enter ‘yes’.

It is also possible that with the command line, a user cannot navigate to the WP root folder.  Therefore, a user has to navigate there to its own. To check the availability in the root folder, type ls in the command line then a list of WP folders like wp-content and wp-admin will appear, a user has to navigate there otherwise. Being in the HTML directory, make sure to run the command to open the wp-config.php using Nano. Make sure to check that the WordPress memory exhausted error is disappeared.

Concluding Remarks

It can be concluded that each web host is required by the website with some resources. The more allocated memory leads to fewer errors. From the tips mentioned above and tricks, hopefully, a user will not encounter any WordPress memory exhausted error.