Increasing WordPress Memory Limit: A Two-Step Process

Complete guide for increasing WordPress memory limits through PHP Selector and wp-config.php modifications to resolve fatal memory errors.

Increasing WordPress Memory Limit: A Two-Step Process

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:

  1. Log in to your cPanel account
  1. Find and click on the "Select PHP Version" icon under the "Software" section
  1. In the PHP Selector interface, choose the PHP version you're using for your WordPress site
  1. Click on the "Options" tab
  1. Look for the "memory_limit" directive
  1. Set the value to "512M" (or the highest available option)
  1. 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

  1. In cPanel, open the File Manager
  1. Navigate to your WordPress root directory (usually public_html)
  1. Locate wp-config.php and right-click to edit
  1. 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');
  1. Save the changes and close the file

Option B: Using SFTP

  1. Connect to your site using an SFTP client
  1. Navigate to your WordPress root directory
  1. Download wp-config.php to your local machine
  1. Open wp-config.php in a text editor
  1. Add the same code as mentioned in Option A
  1. 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:

Did this answer your question?
๐Ÿ˜ž
๐Ÿ˜
๐Ÿคฉ

Last updated on November 19, 2024