PHP Fatal error: Allowed memory size of 134217728 bytes exhausted

Did your WordPress website run into the PHP Fatal error ‘Allowed memory size of 134217728 bytes exhausted’?

This happens if there is not enough memory assigned to the PHP Hypertext Preprocessor or if the memory consumption of your WordPress Installation is limited.

How to fix the Memory Exhausted Error?

First of all, check out how much memory is assigned to PHP and look at the system info log. Go to WP Staging > Tools > System Info to do so:

This should be at least 128M or better 128M

A more precise alternative is to create an empty file and add the code below into it:

<?php echo phpinfo();

Save the file as info.php and upload it to the root of your website via FTP or a file manager plugin.

Now open and find the line memory_limit

This line tells you the exact amount of memory in megabytes your site uses.

For WordPress, this memory limit should be at least 128M or better 256M.

If the memory limit is lower you need to raise it. You can raise the PHP memory limit by editing the PHP.ini. Open the PHP.ini and find the line memory_limit and change the value to:

memory_limit = 256M

Please ask your hosting provider where you can find the PHP.ini.

If you have no access to that file you can try to edit your .htaccess file and add the code below to it:

php_value memory_limit 256M

Now, open the file info.php or the system info log again and check out if the memory limit has been increased.

If you were successful and phpinfo() shows the correct memory_limit you can use again WP Staging and the ‘Allowed memory size exhausted’ error should be solved and gone.

Increase WordPress Memory Limit

If you still get the error you can also try to increase the WordPress Memory Limit.

Open the file wp-config.php and paste the code below just before the line that says ‘That’s all, stop editing! Happy blogging.’:

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

Now, try again if WP Staging works as intended.

If you are still not able to increase the memory limit please ask your hosting provider if they can do it for you.