Increase PHP Memory limit – that’s one of the most popular search terms for WP usrs. The default memory limit for WordPress is 32MB. It is very common to get Memory Size Exhausted Error with certain plugins or themes. The fatal error message looks like:
Fatal Error: Allowed Memory size of xxxxxxxx bytes exhausted….
This type of error arises because your Host’s PHP Memory limit is quite less than what is required by the process to perform its functions.
Well in that case, you will have to increase PHP memory limit. You can follow any of these 3 tips to increase the PHP Memory limit:
Change Memory limit in php.ini File
Editing php.ini file is the most common and easiest way to increase memory limit only if you have direct access to PHP.ini file. Many Shared hosting providers doesn’t give you direct access to the PHP.ini file. In that case you have to create you own php.ini file in the directory where your WordPress site is installed. Or you might need to contact your web host.
Add the following line of code within your php.ini file
memory_limit = 64M
This would increase the memory limit to 64 MB.
Change Memory limit in wp-config.php File
There is no need to create any extra file in your directory. This option is best for you if you don’t have direct access to php.ini file. To increase memory limit via wp-config.php file, simply add the following line of code in your wp-config.php file:
define (‘wp_memory_limit’, ‘64M’)
This would increase PHP memory limit to 64MB. Still if you get any fatal error message then you can contact with your host. This is because they give you direct access to their php.ini file to increase memory limit.
Edit your .htaccess file
When you install WordPress at beginning you don’t have .htaccess file. In such case you have to create it by your own to increase memory limit. If you already have .htaccess file then simply add the following code in your .htaccess file:
php_value memory_limit 64M
This would increase PHP Memory Limit to 64MB.
If you are using too many plugins then you will definitely have to increase your maximum memory limit which you can easily do by any of the methods listed above.