Increase PHP Memory to Fix the WordPress Memory Exhausted Error

Are you getting a WordPress error that says “Allowed Memory Size Exhausted”? This is one of the most common WordPress issues, and it’s simple to remedy by increasing WordPress’s php memory limit. In this article, we’ll teach you how to increase PHP memory to fix the WordPress memory exhausted problem.

What is the meaning of the WordPress Memory Exhausted Error?

PHP is a server-side programming language, and WordPress is written in it. For a website to work effectively, it requires a WordPress hosting server.

Web servers operate in the same way as any other computer. They require memory to execute numerous apps efficiently at the same time. Varied applications, including PHP, are allotted different amounts of memory by server administrators.

This issue appears when your WordPress code uses more memory than the default allocated memory.

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line xxx

If the PHP memory limit is less than 64MB, WordPress will try to increase it by default. However, 64MB is frequently insufficient.

After that, let’s look at how to boost PHP memory limit in WordPress to avoid memory exhaustion.

To increase the PHP memory limit in WordPress, go to your WordPress site’s wp-config.php file and make the necessary changes. It’s in the root folder of your WordPress site, and you’ll need to use an FTP programme or your web hosting control panel’s file manager to access it.

Then, just before the line that says ‘That’s all, finish editing!’, add this code into the wp-config.php file. ‘Have fun blogging.’

define( 'WP_MEMORY_LIMIT', '256M' );

This code tells WordPress that the PHP memory limit should be increased to 256MB.

When you’re finished, save your modifications and re-upload your wp-config.php file to your server.

You should now be able to access your WordPress site, and the memory exhausted error should be gone.

If you’re new to WordPress, check out our beginner’s guide to copying and pasting code from the internet.

We also offer a tutorial on how to locate and edit the wp-config.php file.

Note: If this approach doesn’t work for you, it’s because your web hosting company won’t let you boost the PHP memory limit. You’ll have to explicitly request that your web hosting provider boost your PHP memory limit.

That’s all there is to it; we hope this post assisted you in resolving the WordPress memory exhausted problem by increasing the PHP memory limit. You might also be interested in our step-by-step beginner’s guide to WordPress error troubleshooting.

Leave a Reply