Family Encyclopedia >> Electronics

Fix WordPress out of memory error - Increase PHP memory

Are you seeing an out of allowed memory size error in WordPress? This is one of the most common WordPress errors, and you can easily fix it by increasing the PHP memory limit in WordPress. In this article, we will show you how to fix WordPress out of memory error by increasing PHP memory.

Fix WordPress out of memory error - Increase PHP memory

What is WordPress out of memory error?

WordPress is written in PHP, which is a server-side programming language. Every website needs a WordPress hosting server to function properly.

Web servers are just like any other computer. They need memory to efficiently run multiple applications at the same time. Server administrators assign a specific memory size to different applications, including PHP.

When your WordPress code requires more memory than the default allocated memory, you may see this error.

 Error grave: el tamaño de memoria permitido de 33554432 bytes se agotó (se intentó asignar 2348617 bytes) en /home4/xxx/public_html/wp-includes/plugin.php en la línea xxx 

Fix WordPress out of memory error - Increase PHP memory

By default, WordPress automatically tries to increase the PHP memory limit if it is less than 64 MB. However, 64MB is often not high enough.

With that said, let's see how to easily increase the PHP memory limit in WordPress to avoid an out of memory error.

Increase PHP memory limit in WordPress

You must first edit the wp-config.php file on your WordPress site. It is located in the root folder of your WordPress site, and you will need to use an FTP client or file manager in your web hosting control panel.

Next, you need to paste this code into the wp-config.php file just before the line that says 'That's it, stop editing! Happy blogging'.

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

This code tells WordPress to increase the PHP memory limit to 256MB.

Once you're done, you need to save your changes and upload your wp-config.php file back to your server.

You can now visit your WordPress site and the out of memory error should now be gone.

If you're new to WordPress, check out our beginner's guide on how to copy and paste code from the web.

We also have a step-by-step guide on how to find and edit the wp-config.php file.

Note: If this solution does not work for you, it means that your web hosting service provider does not allow WordPress to increase the PHP memory limit. You will need to ask your web host to increase your PHP memory limit manually.

That's all we hope this article has helped you resolve WordPress out of memory error by increasing PHP memory limit. You can also check out our step-by-step beginner's guide to troubleshooting WordPress issues.

If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.