أهم النقاط
- A script tried to use more memory than PHP allows.
- Raise WP_MEMORY_LIMIT and PHP's memory_limit together.
- If the error returns, find the plugin or theme that leaks memory.
The full message looks like this: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes). The number is PHP’s limit in bytes — here, 128 MB.
Raise the limit
- Connect with cPanel’s File Manager or SFTP and open
wp-config.php. - Above the line that says
/* That's all, stop editing! */, add:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); // used in the admin area
- In cPanel, open MultiPHP INI Editor, select the domain and set
memory_limitto256Mor higher. - Reload the page that failed.
Find the cause
Raising the limit fixes the symptom. If a normal page needs more than 256 MB, something is inefficient.
- Note where it happens — a specific admin page, an import, or every page?
- Deactivate plugins one by one (or rename
wp-content/pluginstemporarily via File Manager) and retest. - Switch to a default theme to rule out the theme.
- Turn on debug logging to see the file that triggered the error.
الأسئلة الشائعة
How much memory does WordPress need?
A typical site runs comfortably at 128–256 MB. Page builders, WooCommerce and large imports may need 256–512 MB.
I set WP_MEMORY_LIMIT but nothing changed.
WordPress can't raise memory above PHP's own memory_limit. Raise memory_limit in cPanel's MultiPHP INI Editor too.