Do you see an insufficient allowed memory size error in WordPress? This is one of the most common WordPress errors, and you can quickly fix it by increasing the PHP memory limit in WordPress. In this article, we will show you how to fix WordPress out-of-memory errors by increasing PHP memory.
What is WordPress running out of memory?
WordPress is written in PHP, which is a server-side programming language. Every website needs a WordPress hosting server to function correctly.
Web servers are like any other computer; they require memory to run multiple applications simultaneously and efficiently. Server administrators allocate a specific memory size for different applications, including PHP.
You may see this error when your WordPress code requires more memory than the memory allocated by default.
Fatal error: the authorized memory size of 33554432 bytes exhausted (2348617 bytes attempted to allocate) in /home4/xxx/public_html/wp-includes/plugin.php online xxx
By default, WordPress automatically tries to increase the PHP memory limit by less than 64MB. However, 64MB is often not high enough. Some WordPress themes like Additional Yes News magazine need more than 64MB for optimal performance.
Let’s see how to quickly increase the PHP memory limit in WordPress to avoid memory errors.
WordPress is running low on memory: Increase PHP memory limit in WordPress
First, you need to edit the wp-config.php file on your WordPress site. It’s located in the root folder of your WordPress site, and you’ll need to use an FTP client or file manager in your web hosting control panel.
Then you need to paste this code into the wp-config.php file just before the line that says, “That’s it, stop modifying! Good blog. ‘
define( 'WP_MEMORY_LIMIT', '128M' );
This code tells WordPress to increase the PHP memory limit to 256MB.
Once you are done, you need to save your changes and upload your wp-config.php file to your server. It is also possible that you can modify it directly from your hosting control panel.
You can now visit your WordPress site, and the out-of-memory error should go away now.
Note: If this solution does not work for you, it means that your web host does not allow WordPress to increase the PHP memory limit. You will need to manually ask your web host to increase your PHP memory limit.
We hope this article helped you resolve the WordPress memory error by increasing the PHP memory limit. You can also check out our step-by-step guide to troubleshooting WordPress errors.