Fix: WordPress Memory Exhausted Error – Increase PHP Memory



WordPress memory exhausted error is one of the most common WordPress errors and it appears when your website has too many plugins or too much content. In this case, you should increase the PHP memory limit in your wp-config.php file.

In this tutorial, I will show you how to change the PHP memory limit in your WordPress installation. This is a very useful tip if you are running any kind of a heavy website on your server. It can also be useful if you are hosting a WordPress website for someone else.

WARNING: Changing the memory limit in your php.ini file is not recommended unless you know what you are doing. Make sure you have a VERY good reason before you make such a change. If you do decide to change the memory limit, you should do it ONLY at your own risk and on a test server first so you can easily restore the settings if needed.

If you do decide to change the memory limit, please remember to always backup your site’s database first! What is the PHP memory limit? The PHP memory limit is the maximum amount of memory (in kilobytes) that the PHP web server will allow your scripts to use. If you try to allocate more memory than this setting allows, your script will crash with an “Out Of Memory” error. Why should you care about the PHP memory limit? You should care about the PHP memory limit because if you are running a heavy website or a lot of WordPress installations, you may eventually hit this limit. The reason is that every time you run a script in PHP, it creates an entirely new copy of itself in memory.

So, if there are 20 different scripts on a given page, each of those scripts will get its own copy of the entire website in memory. Therefore, if you have a memory limit of 1 MB, you can only have 1,000 copies of your website (including all graphics and other media) in memory at any one time. If you have a memory limit of 2 MB, you can only have 2,000 copies of your website in memory at any one time. And so on. This means that if you are running a very heavily trafficked website, you may eventually reach a point where the amount of memory your website is using is so great that the server cannot handle it anymore and it will start to “kill” processes to make room for new ones. What should you do if you are near or at the PHP memory limit? The first thing you should do is to reduce the number of scripts on each page of your website.

The second thing you should do is to reduce the size of each individual script. And the third thing you should do (if you can) is to switch from using PHP to using another language such as ASP or JSP. The reason for this is that those other languages are compiled into a single machine code file (i.e., an executable program) which, in turn, is much smaller than the PHP source code. Therefore, if you have to use PHP, you should use it only for its “killer features” and minimize its use for routine tasks. For example, you should only use PHP for things such as calculating a user’s credit card expiration date or verifying whether or not a given e-mail address exists. Anything beyond that should be done in a “plain vanilla” (non-PHP) language. Oh wait! I almost forgot the most important thing you can do. The most important thing you can do (if you are running a website with heavy traffic) is to upgrade your server.



Fix: WordPress Memory Exhausted Error – Increase PHP Memory

1. Open your file manager (Control Panel > Program Files > Accessories > File Manager)

2. Navigate to /public_html/wp-content/uploads/

Hi, I'm Shahnawaz.

[Video Course] How To Make Money With Amazon Affiliate Niche Sites 2020

By signing up you agree to our terms

3. Right-click on the php.ini-dist file and choose “Open With”

4. Click on “Notepad”

5. Find the memory limit directive (it will be something like “memory_limit = 128M”) and increase the value by typing in

OR

1. Open your wp-config.php file located in the root directory of your website.

2. Scroll down until you see the line: define(‘WP_MEMORY_LIMIT’, ‘64M’);

3. Change the number 64 to any number which is larger than your current setting. For example, if your memory limit is set to 32M, change it to 128M or 256M or even

 OR

1. Open your wp-config.php file located in the root directory of your WordPress installation.

2. Scroll down to the bottom of the file and locate the line that says “memory_limit=”.

3. Place the following line above that line: ini_set(‘memory_limit’, ‘1024M’);

4. Restart your web server.

5. Login to your WordPress Admin area.



Rate this post

The Simple Secret to Increase Traffic & Income

I share 80% Secrets on Emails !