Fix “Allowed memory size exhausted” (PHP memory limit)
- 20.02.2026 00:58
-
- hosting
- performance
- php
- troubleshooting
The error below means that PHP ran out of allowed memory while executing a script:
PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)
On GARMTECH hosting, the most common causes are heavy WordPress plugins/themes, large imports, or scripts that load too much data into memory.
1) Confirm where the error happens
- In Plesk, open Websites & Domains → select your domain → Logs and check the error log around the time of the issue.
- If it is a WordPress website, you can also enable WordPress debugging (temporary) to capture the exact error.
2) Increase PHP memory_limit in Plesk
- Log in to Plesk.
- Go to Websites & Domains → your domain.
- Open PHP Settings.
- Find memory_limit and increase it (common values:
256Mor512M). - Click Apply (or save changes).
Note: your hosting plan may have limits. If you cannot set the value you need, you may need to optimize the website or upgrade the plan.
3) Check for overrides (.user.ini / .htaccess / wp-config.php)
Sometimes the value is overridden by per‑directory settings:
.user.ini(often containsmemory_limit=...).htaccessdirectives (LiteSpeed supports common Apache-style directives)wp-config.php(WordPress can defineWP_MEMORY_LIMIT)
If you changed memory_limit in Plesk but the error continues, search your website files for memory_limit and remove conflicting settings.
4) Reduce memory usage (recommended)
- Update WordPress core, plugins and theme.
- Temporarily disable recently added plugins and test again.
- Avoid importing huge files in one step (split imports when possible).
- Optimize images and database if the site is very large.
5) If the error happens during a one-time task
For large operations (imports, backups, migrations) it can be more reliable to run them via CLI (SSH) or on a VPS where you control server limits.
Related Articles
Comments
Add Comment