# How to Investigate PHP Memory Exhaustion Before Raising Limits

https://ferkesh.net/uk/baza-znan/stattia/php-memory-exhausted-evidence

![Workflow: Capture the error context; Reproduce on staging; Measure the cause; Verify the chosen correction.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-12.svg#php-memory-exhausted-evidence)

An allowed-memory fatal error describes a limit reached in one PHP process. First determine which request and runtime produced it, especially on a shared host with different per-domain settings.

## Procedure

1. **Capture the error context.** Record the timestamp, request path and permitted byte count. Read nearby errors privately. Filter logs rather than publishing full paths, payloads or customer details.
2. **Reproduce on staging.** Use a safe equivalent workload and confirm the active PHP version and memory limit for that request. Separate a large import or media job from an ordinary page request.
3. **Measure the cause.** Compare input size, extensions, theme version and background activity. Check whether batching a job or fixing a regression reduces usage before considering a larger limit.
4. **Verify the chosen correction.** Repeat the failing job and ordinary traffic tests on staging. Record peak memory and host ceilings. If the host approves a new limit, watch process counts and errors after deployment.

## Related guides

- [How to Diagnose PHP Errors from Private Logs](https://ferkesh.net/knowledgebase/article/php-error-logs)
- [How to Verify a PHP Extension on the Actual Plesk Runtime](https://ferkesh.net/knowledgebase/article/plesk-check-php-extension)
- [Developer Resources articles](https://ferkesh.net/knowledgebase/category/developer-resources)

## Official references

- [PHP core directives](https://www.php.net/manual/en/ini.core.php)
- [WordPress debugging](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/)

Ferkesh Hosting. Last reviewed November 26, 2026.
