PHP Fatal error: Allowed memory size of 134217728 bytes exhausted
Script buffered large query/file payload exceeding `memory_limit` (default 128M).
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.1.0
Identifier: PHP Fatal error
Platform: PHP
Common Root Causes:
- Script buffered large query/file payload exceeding `memory_limit` (default 128M).
Interactive Diagnostic Checklist
Verified Solutions:
- Stream large datasets with generators/cursor pagination rather than loading entire tables into RAM.
Safe Diagnostic Command:
php -i | grep memory_limit
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.
Technical Explanation
Script buffered large query/file payload exceeding `memory_limit` (default 128M). Recommended diagnostic: `php -i | grep memory_limit`. Remediation: Stream large datasets with generators/cursor pagination rather than loading entire tables into RAM.
Worked Examples
- Run `php -i | grep memory_limit` to verify root cause before applying the remediation.
Limitations & Assumptions
- Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.
Source References & Verification
Resource ID: err-php-memory-limit-exhausted · Independently verified: 2026-11-25