WordPress is developed based on the PHP language, and like all PHP applications or scripts, it consumes RAM and CPU resources, among other resources at the expense of your hosting.

WordPress comes pre-configured to use a maximum of 40MB of server RAM per process. This limit is determined even if your PHP memory_limit is set higher, so if we want WordPress to be able to use more memory per process, this should be specified in the wp-config.php file of your WordPress installation.

As long as memory_limit in PHP is high, we can specify the parameter that appears below in the wp-config.php file, with the corresponding value. Editing and modifying the wp-config.php file is a very easy process, as you can do it by going to your WordPress site files, selecting the wp-config.php file, and then clicking Edit.

If we want to put a maximum of 128MB of memory to use per process, we'll have to put this line in the wp-config.php file:

 

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

 

If we want to add a maximum memory of 256MB per process, we should use this:

 

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

 

Is the process easy? Most of today's complex plugins and themes can require more memory than the default maximum of 40MB, so changing the memory limit in WordPress can help us solve the problems.

WooCommerce is one of those plugins that need more than 40MB of memory per process to function. In addition to WooCommerce, there are many others, such as LearnPress or well-known templates such as Divi.

Finally, I would like to point out again that if the memory limit set in the PHP config for the server is less than the limit set in WordPress via the wp-config.php file, then the limit that will be set is the server limit and this can cause a huge error.

We recommend that you modify the php.ini file and adjust the memory there as well.

Was this answer helpful? 2322 Users Found This Useful (3233 Votes)