Fatal Error: Allowed Memory Size Exhausted
Last Update: December 1, 2025
It’s common to get fatal error messages about memory: ‘Fatal Error: Memory Size Exhausted’. This can happen when you install themes or plugins, or when you upgrade to the latest WordPress version. Such problems arise because the PHP Memory Limit on your Host is less than what the process requires to perform its functions. In such a case, you would need to follow these steps to increase your host’s PHP Memory Limit.
Tip 1: Increase the limit via PHP.ini file
You can directly increase the PHP Memory Limit if you’ve access to the PHP.ini file. Most small shared hosting servers won’t give you access to the php.ini file. But some servers allow you to create a duplicate php.ini file in your site’s Directory, whose settings override the default php.ini settings.
To do that, you need to make a file with the name ‘php.ini’ in the directory where your WordPress site is installed. In that, add the command memory_limit = 128M to increase the Memory Limit to 128 MB.
Tip 2: Changing the Memory Limit via wp-config.php
If you don’t want to mess with the PHP.ini file, then you can go for this method. In this, you won’t need to create any extra file in your Directory. Just adding to the web server’s ‘wp-config.php’ file will increase your PHP Memory Limit to 128 MB.
Alternatively, you can use the following, which does the same as outlined in Tip 1, just in your ‘wp-config.php’ file.
Tip 3: Modifying the .htaccess file to Increase Memory Limit
A Default WordPress Installation won’t have a .htaccess file. But in case you already have it for some purposes like ‘301 Redirection’, just add the following command to the web server’s ‘.htaccess’ file and your memory limit will increase to 128MB.
Tip 4: Have a talk with your Host
If you are new to all these techie-sounding things, it’s better to have a Live Chat / a Call with your Host right away. It’s your right to talk to them & get the necessary changes you need as you’re paying for it.
