A "memory exhausted" or "allowed memory size" error means your application needs more PHP memory than is currently allocated. On shared hosting you can often raise this limit within your plan ceiling.
Method 1: Select PHP Version
- Log in to cPanel.
- Open Select PHP Version then go to the Options tab.
- Find
memory_limitin the list. - Select a higher value, such as
256M. - Save the change and reload your site.
This is the cleanest method because it applies to your whole account.
Method 2: Edit php.ini or .user.ini
If you prefer a file-based approach, create or edit a .user.ini file in your site root:
memory_limit = 256M
max_execution_time = 120
Save the file, then wait a few minutes for the new value to take effect.
Method 3: wp-config.php for WordPress
For WordPress specifically, add this line above the "stop editing" comment in wp-config.php:
define('WP_MEMORY_LIMIT', '256M');
Limits on Shared Hosting
Shared plans cap how much memory a single account can use to keep the server fair for everyone. If your application still runs out of memory after raising the limit, the script may be inefficient, or you may need a larger plan. You can review options at my.nairohost.site or ask support on WhatsApp at +254 796 358081 to confirm your maximum allowed value.