Adjusting the PHP memory limit with CloudLinux in DirectAdmin

memory_limit limits memory available to an individual PHP script. Increasing it can help a legitimate resource-heavy task, but it does not increase your hosting account's RAM allowance or correct an application memory leak. Diagnose the workload before changing the value.

What you need before you begin

Record the complete memory-exhaustion error, current PHP limit and account resource usage at the same time. Check whether the problem affects one import, a large image, a plugin or every request. Take a backup before changing application components during diagnosis.

01 Change the setting

  1. In DirectAdmin, open the appropriate user account and domain, then search for Select PHP Version. In Evolution it may appear under Extra Features. Open the CloudLinux selector, not an unrelated server administration page.
  2. Check the active PHP version and which websites the selector change will affect. DirectAdmin can expose both its native PHP selection and CloudLinux PHP Selector. The selected domain in DirectAdmin does not by itself prove that an Alt-PHP change is isolated to that domain. Check the selector scope before applying an account-wide change.
  3. Open Options and locate memory_limit. Record the existing value.
  4. Choose a modest increase within the available plan and server limits, then save. Do not set unlimited memory as a general repair. Newer PHP versions can also enforce a server-controlled maximum memory setting.
  5. Retry the single failing task and watch account resource usage. Where possible, reduce import batch sizes or process large jobs through the application's supported background workflow.

Confirm the expected result

Confirm the effective memory limit in the web application and verify that the task completes. Check logs and resource graphs afterward. A successful single request is not proof that many concurrent requests fit within the account's total memory allowance.

What should I investigate if a higher PHP memory limit does not fix the failure?

If failures continue, restore unnecessary changes and investigate the component allocating memory. A CloudLinux account memory fault and PHP's Allowed memory size exhausted message are different limits. A missing option or capped value requires support review, not an Apache RLimitMem max workaround.

  • 0 Users Found This Useful
  • control-panels, development
Was this answer helpful?

Related Articles

Changing the PHP version with CloudLinux in DirectAdmin

A PHP version change can make an application compatible with current dependencies and security...

Managing PHP extensions with CloudLinux in DirectAdmin

Extensions add capabilities such as database access, multibyte text handling, image processing...

Configuring allow_url_fopen with CloudLinux in DirectAdmin

allow_url_fopen controls whether PHP file functions can use supported URL wrappers, such as...

Configuring PHP error display and logging with CloudLinux in DirectAdmin

PHP errors are useful for diagnosis, but displaying them on a public site can expose filesystem...

Changing the PHP post_max_size limit with CloudLinux in DirectAdmin

post_max_size limits the size of the entire HTTP POST body received by PHP. It includes...