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.
IN THIS ARTICLE
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
- 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.
- 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.
- Open Options and locate memory_limit. Record the existing value.
- 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.
- 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.
Related articles
- Resolving PHP memory exhaustion without hiding the cause
- Understanding CPU, RAM, storage, inodes and data transfer
- Changing PHP versions, extensions and application limits
- Changing the PHP post_max_size limit with CloudLinux in DirectAdmin
- Configuring PHP error display and logging with CloudLinux in DirectAdmin