How to Increase PHP Memory Limits for WordPress
Comprehensive guide on checking and increasing WordPress memory limits, with both self-service steps and support-assisted options.
How to Increase PHP Memory Limits for WordPress
Overview
This guide explains how to check and increase the PHP memory limit for your WordPress installation on WPCloud. Generally, most WordPress installations work efficiently with our default settings. However, if you need to increase your memory allocation for specific plugins or operations, this guide will show you how.
Understanding Your Container Resources
Every WordPress installation on WPCloud runs in its own isolated container with dedicated resources. By default, we allocate 1 gigabyte (1GB) of RAM to each container. This isolation ensures that one website's performance cannot impact another.
Your container's RAM is used by several critical components:
- PHP processes for running WordPress
- MySQL database queries
- LiteSpeed web server operations
- Caching systems (LSCache, Memcached)
- Background tasks and cron jobs
- Plugin and theme operations
This explains why a seemingly simple WordPress site might need significant RAM - it's not just WordPress itself, but all these supporting services working together to keep your site fast and responsive.
If your website requires additional RAM beyond the default 1GB allocation, please contact WPCloud support for pricing on additional resources. Our team can analyze your site's resource usage and recommend the appropriate upgrade package to ensure optimal performance.
Prerequisites
- Active WPCloud hosting account
- cPanel access credentials
- Basic understanding of WordPress file structure (for manual method)
Method 1: Checking Current Memory Allocation
- Access PHP Selector
- Log in to your cPanel account
- Scroll to the "Software" section
- Click on "Select PHP Version"

- View Current Memory Settings
- In PHP Selector, click on "Switch to PHP Options"
- Look for "memory_limit" setting
- Default value should show 512M

Method 2: Manual Configuration via wp-config.php
- Access wp-config.php
- Connect to your site via File Manager in cPanel
- Navigate to your WordPress root directory
- Locate wp-config.php
[Visual Aid Suggestion: Screenshot of File Manager showing wp-config.php location]
- Add Memory Limit Definitions
- Add these lines before the "/* That's all, stop editing! */" comment:
define('WP_MEMORY_LIMIT', '512M');
define('WP_MAX_MEMORY_LIMIT', '512M');

- Save Changes
- Click "Save Changes" in File Manager
- Clear your browser cache
Method 3: Request Support Assistance (Recommended)
The simplest and safest method is to contact WPCloud support:
- Open a support ticket or email support@wpcloud.ca
- Request the desired memory limit increase
- Support team will implement the change server-side
- No technical knowledge required
Common Issues and Solutions
- Issue: Memory size exhaustion errors in error logs
- Example error:
- Solution: This error indicates your WordPress installation needs more memory allocation. You can:
- Follow the steps in this article to increase the memory limit, or
- Simply contact WPCloud support, and we'll handle the memory allocation adjustment for you
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20971520 bytes) in /home/username/public_html/wp-includes/plugin.php on line XXX
- Issue: Unable to access PHP Selector
- Solution: Contact WPCloud support for assistance. This is typically a permissions-related issue that our team can quickly resolve.
Best Practices
- Monitor Resource Usage
- Regularly check your site's memory usage through cPanel metrics
- Watch for memory-related errors in error logs
- Optimize First
- Before requesting more memory, consider:
- Deactivating unused plugins
- Cleaning up post revisions
- Security Considerations
- While it's good practice to be cautious with configuration changes, WPCloud maintains 30 days of backups for all files, including wp-config.php
- Keep track of memory limit modifications
When to Contact Support
Contact WPCloud support immediately if you:
- Are unsure about making configuration changes
- Need immediate memory limit adjustments
- Experience persistent memory-related errors
- Need guidance on optimal memory allocation
Support Options
For assistance with memory limit adjustments:
- Submit a support ticket through the client portal
- Email support@wpcloud.ca
- Typical response time: Within 15 minutes
Note: WPCloud support team is available 24/7/365 and can implement these changes quickly and safely on your behalf.
Last updated on November 21, 2024