Does this match what you’re seeing?
- Log shows ‘Allowed memory size of N bytes exhausted’
- Large imports, exports or image uploads fail
- The page is blank or shows a 500 error
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes)
A single request tried to use more memory than memory_limit allows (134217728 bytes = 128MB). The “tried to allocate” figure is just the last small piece that tipped it over.
1. Find which script and when
The error log line includes the file and line. Note what triggered it: a particular page, an import, an image upload, a cron job.
2. Check the current limit
Look at memory_limit in phpinfo. How to check which PHP version your site is using
3. Fix the cause where possible
| Trigger | Better approach |
|---|---|
| Importing a large CSV or database | Process in batches; import databases outside PHP (Importing a database that’s too large for phpMyAdmin) |
| Image processing | Resize images before uploading |
| Loading a whole table into an array | Paginate queries or iterate with a cursor |
| A plugin on every page | Replace or reconfigure that plugin |
| Backup plugins zipping the whole site | Use DirectAdmin’s backup feature instead |
4. Raise the limit if it’s genuinely needed
See whether memory_limit is adjustable for your account. Changing PHP settings: memory_limit, upload size and execution time For WordPress, also set WP_MEMORY_LIMIT. “Allowed memory size exhausted” in WordPress
A page that routinely needs several hundred megabytes on a small site is a sign of a problem, not a need for a bigger limit.
Not with Traxio yet? You can try this on a real server with our free PHP hosting trial: 30 days free with no card, then £0.99 a month.