Sometimes increasing the PHP memory limit in php.ini does not resolve memory-related errors. Even after updating the configuration, applications like WordPress may still display out of memory errors.
This usually happens because Apache memory restrictions override PHP settings.
Why PHP Memory Limit Changes May Not Work
In cPanel/WHM servers, Apache can enforce its own memory limits independent of PHP configuration.
You should verify the following WHM setting:
WHM → Service Configuration → Apache Configuration → Memory Usage Restrictions
This feature controls Apache’s memory usage based on historical resource consumption.
How Memory Usage Restrictions Work
The Memory Usage Restrictions option:
- Limits memory usage per Apache process
- Improves overall server stability
- Prevents excessive resource consumption
- May slightly reduce performance
When enabled, WHM automatically adds the following directive to the Apache configuration:
RLimitMEM XXX Here, XXX represents the maximum memory allowed for each Apache process.
Why This Causes PHP Memory Errors
If RLimitMEM is configured:
- Apache restricts process memory usage
- PHP cannot exceed this limit
- Increasing
memory_limitinphp.inibecomes ineffective
This commonly affects applications such as:
- WordPress
- CMS platforms
- Large PHP applications
How to Fix the Issue
To allow PHP memory changes to work:
- Locate the Apache configuration file.
- Find the directive:
RLimitMEM XXX - Remove or comment out this line.
- Restart Apache services.
- Increase the required value in
php.ini.
After removing the restriction, PHP memory settings will function correctly.
Conclusion
If PHP memory limit updates are not taking effect, the issue is often caused by Apache’s Memory Usage Restrictions in WHM. Adjusting or disabling the RLimitMEM directive resolves most out-of-memory errors.
If you require help, contact SupportPRO Server Admin
Partner with SupportPRO for 24/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.
