Home MiscellaneousWhy PHP Memory Limit Changes Don’t Work in WHM ?

Why PHP Memory Limit Changes Don’t Work in WHM ?

by SupportPRO Admin

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_limit in php.ini becomes 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:

  1. Locate the Apache configuration file.
  2. Find the directive:
RLimitMEM XXX
  1. Remove or comment out this line.
  2. Restart Apache services.
  3. 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.

Contact Us today!
guy server checkup

You may also like

Leave a Comment