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 cPanel, search for Select PHP Version and open the CloudLinux tool. It is commonly listed under Software. Select the intended domain if your installation displays a domain selector.
- Check the active PHP version and which websites the selector change will affect. cPanel may also offer MultiPHP Manager and MultiPHP INI Editor. These tools manage a different PHP configuration path. Identify whether the domain uses CloudLinux Alt-PHP or a native EasyApache PHP handler before editing.
- 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. On PHP 8.5 and later, the server-controlled
max_memory_limitsetting can also cap the value you may configure. - 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 cPanel
- Configuring PHP error display and logging with CloudLinux in cPanel