PHP Fatal error: Allowed memory size of 134217728 bytes exhausted means a PHP script tried to use more memory than it's allowed, so PHP stopped it. Your visitors usually see a blank page, a 500 error, or WordPress's "There has been a critical error on this website" message. This guide explains what the allowed memory size exhausted error means and how to fix it by raising memory_limit in your Instant Access Internet Services cPanel -- and when raising it won't help.
What the error looks like
You'll find it in your error_log file, WordPress's debug.log, or the WordPress "Technical Issue" email:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/username/public_html/wp-content/plugins/some-plugin/file.php on line 123
It tells you three things:
- The limit ("Allowed memory size of ... bytes"). This is your current
memory_limit. - How much more it wanted ("tried to allocate ... bytes"). Usually small -- the script used up the limit bit by bit.
- Where it ran out. The file path often names the plugin or theme at fault, but not always: the script that ran out may just be the last straw.
To turn the byte number into a setting:
| Number in the error | memory_limit |
|---|---|
| 67108864 | 64M |
| 134217728 | 128M (our default) |
| 268435456 | 256M |
| 536870912 | 512M |
How to fix it: raise memory_limit in MultiPHP INI Editor
- Log in to cPanel and go to Software > MultiPHP INI Editor.
- On the Basic Mode tab, choose your domain from the menu under Configure PHP INI basic settings.
- Find
memory_limitand change it to256M. - Click Apply.
- Reload the page that failed.
256M is enough for most WordPress and WooCommerce sites. Large shops, page builders and big imports sometimes need 512M. Only go higher if a plugin's documentation specifically asks for it. For more on this editor, see How to Change PHP Settings (memory_limit, upload_max_filesize).
If the change doesn't take effect
If the error still shows the old number, something else is setting the limit:
- Wrong domain. Check you picked the right domain (a subdomain site needs its own setting) and clicked Apply.
- Old settings files. Look in your site folder for
php_value memory_limitlines in.htaccess, or aphp.inior.user.inicopied from a previous host. Remove the old line so the MultiPHP INI Editor value wins. (php_valuelines in.htaccesscan also cause 500 errors, so it's best to remove them anyway.) - WordPress settings.
wp-config.phpmay containWP_MEMORY_LIMITorWP_MAX_MEMORY_LIMIT. These are fine to leave, but if one is set to a small value, raise it to match, for exampledefine( 'WP_MEMORY_LIMIT', '256M' );.
In WordPress you can confirm the current value under Tools > Site Health > Info, in the Server section ("PHP memory limit").
When raising the limit won't help
A higher memory_limit fixes the error when a script genuinely needs a bit more room. It doesn't fix a script that's broken. Suspect a bug if:
- The error keeps coming back at every limit you try (256M, then 512M).
- The "tried to allocate" number is huge, such as hundreds of megabytes or more in one go.
- It started right after a plugin or theme update.
In those cases, update or disable the plugin or theme named in the error path. If you can't reach your dashboard, rename the plugin's folder in Files > File Manager as described in WordPress Critical Error on This Website: How to Fix It.
Also keep your whole account in mind. memory_limit is per script, but every visitor request runs its own copy, and your account has an overall memory limit shown in Metrics > Resource Usage (cPanel Resource Usage Explained: CPU, Memory and Entry Process Limits). Setting memory_limit very high lets a single runaway script use far more of that total, which can lead to 508 Resource Limit Is Reached errors for everyone (508 Resource Limit Is Reached: What It Means and How to Fix It).
A similar error: "Out of memory"
If the log says PHP Fatal error: Out of memory (allocated ...) (tried to allocate ...) without "Allowed memory size", the script didn't hit memory_limit -- it hit your account's overall memory limit. Check Metrics > Resource Usage for memory faults, turn on caching (How to Speed Up WordPress with LiteSpeed Cache), and look for heavy plugins. Raising memory_limit won't help that one.
When to open a ticket
Open a ticket if the new limit won't apply, or you've raised it to 512M and the error continues. Include the full error line from the log, the page or task that triggers it (for example "saving a product" or "running an import"), and the value you set.
Related guides
- How to Change PHP Settings (memory_limit, upload_max_filesize)
- WordPress Critical Error on This Website: How to Fix It
- How to Check Your Website Error Log and Recent Visitors
- cPanel Resource Usage Explained: CPU, Memory and Entry Process Limits
- 508 Resource Limit Is Reached: What It Means and How to Fix It
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
