Sometimes you can get fatal error messages regarding memory such as “Fatal Error: Memory size exhausted”. This usually happens when you install themes, plugins or when you upgrade to the latest WordPress version. Why does that happen? Well, mostly, because the PHP memory limit of your host is quite less than what the process needs for its functions. If that happens, you can follow these 5 tips provided by in order to increase the host’s PHP memory limit.

Increase the limit via PHP.ini file. Most of the small shared hosting servers don’t give you access to the PHP.ini file. Some servers, however, let you create a copy of your PHP.ini in site Directories whose data or values will probably override the default PHP.ini values. All you need to do is create a file with the name “php.ini” in the directory where you installed your WordPress site. There you must add the command “memory_limit = 128M” in order to increase to memory limit.

Change the memory limit through wp-config.php. This is a good option for when you don’t want to mess with the php.ini file. For this, you must only add define (‘WP_MEMORY_LIMIT’, ‘128M’); in your ‘wp-config.php’ file.

Modify the .htaccess file. You should know that A default WordPress Installation doesn’t have a .htaccess file. However, if you have it for “301 redirection”, you must only add the command php_value memory_limit 128M in your “.htaccess” file.

Change the memory limit through wp-config.php.  This is a good alternative to the php.ini method. You only need to place the code ini_set(‘memory_limit’,’128M’); in the ‘wp-config.php’ file which is placed in the root folder of your WordPress installation.

Talk to your host - this is the best option if you are not very tech savvy. You can always talk to them and have them change what needed.