WordPress requires a certain amount of PHP memory to run efficiently. When you encounter an error like the below when certain plugins/themes are performing actions on your site, this means that your site has run out of available memory.
Fatal PHP Error: PHP_ERROR Error #32893. Fatal PHP error encountered:type => 1; message => Allowed memory size of 134217728 bytes exhausted (tried to allocate 2726079 bytes); file => /var/www/vhosts/example.com/httpdocs/wp-admin/includes/class-pclzip.php; line => 2690;
This error indicates that WP attempted to allocate additional memory but hit the limit configured on your server. In this case, increasing the memory limit may help resolve the error.
How to increase the memory limit? #
WordPress allows you to define memory limits within the wp-config.php file. To check if your site is limited by this file, access your site’s files using FTP/hosting panel, and open the wp-config.php file (see Editing and handling wp-config.php).
Inside the file, locate the following lines:
define('WP_MEMORY_LIMIT', '128M');
define('WP_MAX_MEMORY_LIMIT', '128M');
If these lines are set to 128M or lower, increase them to 512M or 1024M or even 2048M, depending on your server’s capacity. Keep in mind that the maximum limit is determined by your hosting provider’s configuration.
Then save the file and restart your server.
What should I do if increasing the memory limit via wp-config.php did not worked and I’m still seeing the same error? #
If increasing the memory limit via the wp-config.php file does not resolve the error, your server may have a lower limit that’s configured at the server-level. In this case, tryi to modify the memory limit directly in your server settings.
If your hosting provider allows access to the php.ini file, locate or create that file in your site’s root directory and add/modify this line:
memory_limit = 128M
You can also try adjusting the .htaccess file by adding/modifying this line:
php_value memory_limit 128M
But if the above recommendations are not working, your hosting provider may have a strict memory limit in place, so it’s best to reach out to them and ask if they can increase the PHP memory allocation for your site and provide the error.
By increasing your site’s memory allocation, you can help ensure smooth performance and avoid unexpected errors while managing your WordPress site.
