If you see an “allowed memory size exhausted” error in WordPress, you should know that it's one of the most commonly seen WordPress errors. Not to worry, you can quickly fix it by increasing the PHP memory limit. We will give you a hand with resolving the problem.
In this post, you will find:
WordPress is written in PHP, which is a server-side programming language. Every website needs a WordPress hosting server for it to function correctly. Web servers are actually like any other computer. They need to have the memory to run multiple applications efficiently at the same time. Server administrators allocate specific memory size to different applications, including PHP.
When your WordPress code requires more memory than the default allocated memory, you get this 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
By default, WordPress will automatically try to increase the PHP memory limit if it's less than 64MB. However, 64MB often is not nearly enough. With that said, let us see how to address the PHP memory limit in WordPress to avoid the memory exhausted error.
There are three ways to address the memory limit:
memory_limit and upload_max_filesize values, you need to access your cPanel account first;memory_limit and upload_max_filesize values to the ones you need for your application;define ('WP_MEMORY_LIMIT', '256M');
memory_limit = 256M;
Notice that in both of the examples, we have used 256 MB as value for the memory limit. However, you should set the value that the theme/plugin requires. Also, those changes can be performed via the cPanel or the FTP service.