Complete guide for increasing WordPress memory limits through PHP Selector and wp-config.php modifications to resolve fatal memory errors.
Overview
To resolve fatal errors related to memory limits in WordPress, follow this two-step process:
Step 1: Increase PHP Memory Limit using CloudLinux Selector
First, ensure your PHP settings allow for increased memory allocation:
- Log in to your cPanel account
- Find and click on the “Select PHP Version” icon under the “Software” section
- In the PHP Selector interface, choose the PHP version you’re using for your WordPress site
- Click on the “Options” tab
- Look for the “memory_limit” directive
- Set the value to “512M” (or the highest available option)
- Click “Save” or “Apply” to confirm the changes
Step 2: Modify wp-config.php to Set WordPress Memory Limits
After increasing the PHP memory limit, you need to tell WordPress to use more memory. You can do this by editing the wp-config.php file:
Option A: Using cPanel File Manager
- In cPanel, open the File Manager
- Navigate to your WordPress root directory (usually
public_html
) - Locate
wp-config.php
and right-click to edit - Add the following lines just before “That’s all, stop editing! Happy publishing.”:
// Increase memory limit for main WordPress installation
define('WP_MEMORY_LIMIT', '256M');
// Increase memory limit for WordPress admin area
define('WP_MAX_MEMORY_LIMIT', '256M');
- Save the changes and close the file
Option B: Using SFTP
- Connect to your site using an SFTP client
- Navigate to your WordPress root directory
- Download
wp-config.php
to your local machine - Open
wp-config.php
in a text editor - Add the same code as mentioned in Option A
- Save the file and upload it back to your server, replacing the existing
wp-config.php
Important Notes
If issues persist after increasing memory limits, contact our support team for further assistance.
Need Help?
If you encounter any difficulties or need additional support:
- Create a support ticket: https://support.wpcloud.ca/clientarea.php
- Email us: support@wpcloud.ca