How to increase PHP memory limit and fix memory exhausted error in WordPress

0
214

32MB is the default PHP memory limit memory limit for WordPress and such limit can be easily reached when using a lot of plugins for example.

If in your WordPress website you see an error like “32 MB – We recommend 64MB” or Fatal Error: Allowed Memory size of xxxxxxxx bytes exhausted…. then you need to increase the php memory limit in your WordPress. There ae 3 ways to do this and in this tutorial I will show you how.

How to increase PHP memory limit and fix memory exhausted error in WordPress using the wp-config.php file

  1. The most common one is to do it via the wp-config.php file.

1.1.Login to your cPanel

1.2.Go to the File Manager

1.3.Find the wp-config.php

1.4.Right click to open the code editor

1.5.Add the following line : define (‘wp_memory_limit’, ‘64M’) at the very top

1.6.Click Save changes and close

How to increase PHP memory limit and fix memory exhausted error in WordPress using the .htaccess file

2. You can also increase the  PHP memory limit in WordPress in your .htaccess file

2.1.Login to your cPanel

2.2.Go to the File Manager

2.3.Find the .htaccess file

2.4.Add php_value memory_limit 64M

How to increase PHP memory limit and fix memory exhausted error in WordPress using the php.ini file

3If you have php.ini file (if you do not, read our article on How to create php.ini file in cPanel and create one) , you can go and increase the php memory limit there too. All you have to do is :

3.1.Go to your cPanel and navigate to the File Manager

3.2.Find the public_html folder

3.3.Right click the php.ini file

3.4.Go for the Code Edit option

3.5.Click the Edit button

3.6.Find the memory_limit

3.7.Enter your new memory limit

3.8.Click Save Changes

If you still experience issues and see the annoying WordPress memory exhausted error, then contact your hosting provider, paste them the error that you see and have the support check this for you and increase the PHP memory limit in their php.ini file if needed.

Thank you for reading this WordPress tutorial on How to increase PHP memory limit in WordPress. I really hope I have managed to help most of the people who need to change the default one.

NO COMMENTS

LEAVE A REPLY