Did your WordPress website run into the PHP Fatal error “Allowed memory size of 134217728 bytes exhausted”?
Did you get a loading error 500 from time to time without any apparent reasons, or did the WP STAGING push/pull process just stopped?
That can happen if there is not enough memory assigned to PHP or if the memory consumption of your WordPress Installation is limited.
Increase WordPress Memory Limit
Try first, increasing 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, check again if your memory errors are resolved.
If this does not resolve your WordPress / PHP memory issues, follow the advice below:
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 256M or higher.
A more precise alternative is to create an empty file and add the code below into it:
<?php echo phpinfo();
Please save the file as info.php and upload it to your website’s root via FTP or a file manager plugin.
Now open https://yoursite.com/info.php and find the line
This line tells you the exact amount of memory in megabytes your site uses.
For medium WordPress sites, this memory limit should be at least 128M or better 256M.
If the memory limit is lower, you need to raise it. You can increase 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 increases.
If you were successful and phpinfo() shows the correct memory_limit, start WP STAGING again, and the error “Allowed memory size exhausted” should be solved and gone.
If you cannot increase the memory limit, please ask your hosting provider if they can do it for you.