What does the error mean?
The message looks like this:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes)
PHP is the language that runs many websites, such as WordPress. Each PHP script gets a fixed amount of memory to work with. Memory is like the size of a desk. If the job needs more desk space than you have, PHP stops and shows this error.
The first number is your limit in bytes. The number 134217728 equals 128 MB. The second number is how much extra PHP asked for when it ran out.
Common causes
- A heavy plugin or theme.
- A big image or file being processed.
- A large import or backup task.
- A script with a bug that loops forever.
Warning: Take a backup before you edit any file. A small typo can break your site.
Fix 1: Raise the limit in php.ini
- Log in to your control panel.
- Open the PHP settings tool, such as MultiPHP INI Editor in cPanel.
- Find
memory_limit. - Change it to a higher value, such as
256M. - Click Save and reload your site.
Fix 2: Use a .htaccess line
- Open the
.htaccessfile in your site's main folder. - Add this line at the bottom:
php_value memory_limit 256M
- Save the file. If you now see a 500 error, remove the line. Your server may not allow this method.
Fix 3: For WordPress, edit wp-config.php
- Open
wp-config.phpin your site's main folder. - Add this line above the text "That's all, stop editing":
define( 'WP_MEMORY_LIMIT', '256M' );
Still not working?
- Turn off plugins one by one to find the heavy one.
- Your plan may cap the memory limit. Ask Hostvento support what the maximum is. You can open a support ticket.
Quick recap
- The error means PHP ran out of its memory allowance.
- Raise
memory_limitin the panel,.htaccessorwp-config.php. - Back up before editing files.
- Find and remove any plugin that uses too much memory.
- Contact support if your plan limits memory.