If your website shows a "Fatal error: Allowed memory size exhausted" message or a blank white page, your PHP scripts are exceeding the default memory limit. Here is how to increase it.
Increase memory_limit in cPanel
Go to cPanel > Software > MultiPHP INI Editor, select your domain, find memory_limit, and change it to 256M or 512M. Click Apply. Changes take effect immediately.
01. Via cPanel (Recommended)
- Log into cPanel > Software > MultiPHP INI Editor
- Select your domain from the dropdown
- Find
memory_limit - Change to
256M(or512Mfor resource-heavy sites) - Click Apply
02. Via .user.ini
Create or edit .user.ini in your public_html directory:
memory_limit = 256M
Changes take effect within 5 minutes.
03. WordPress: wp-config.php
WordPress has its own memory limit separate from PHP. Add this to wp-config.php before the "That's all, stop editing" line:
define('WP_MEMORY_LIMIT', '256M');
For the admin area, which often needs more memory for plugin operations:
define('WP_MAX_MEMORY_LIMIT', '512M');
If you need more than 512M regularly, the issue is likely an inefficient plugin or a code problem rather than a genuine memory need. Check which plugins consume the most memory using Query Monitor or WP-CLI: wp plugin list --fields=name,status. See Optimize WordPress Performance.
For related settings like upload file size limits, see Changing Maximum Upload Size. For PHP version changes, see How to Change Your PHP Version.
Still Getting Memory Errors?
If increasing the limit does not help or errors keep coming back, open a ticket and we will check what is consuming memory on your account.
Open a Support TicketQuick Recap
- cPanel MultiPHP INI Editor - Change memory_limit to 256M
- .user.ini - Alternative method, create in public_html
- WordPress: WP_MEMORY_LIMIT in wp-config.php
- More than 512M usually means a code problem - Investigate plugins
- Changes are immediate via cPanel, 5 minutes via .user.ini
PHP configuration · Last updated March 2026 · Browse all PHP/MySQL articles
