Adjusting the PHP memory limit with CloudLinux in Plesk

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 Plesk, select the correct subscription and open PHP Selector from the available sidebar or additional tools. This guide applies to Linux subscriptions where the CloudLinux integration is installed. Windows Plesk uses its own PHP configuration.
  2. Check the active PHP version and which websites the selector change will affect. Plesk also has a native PHP Settings page for each domain. A CloudLinux setting will not automatically override a different Plesk PHP handler. Confirm which handler serves the website first.
  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
  • plesk, development
Was this answer helpful?

Related Articles

Changing the PHP post_max_size limit with CloudLinux in Plesk

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

Changing the PHP upload_max_filesize limit with CloudLinux in Plesk

upload_max_filesize sets the maximum size of an individual uploaded file accepted by PHP. The...

Configuring PHP error display and logging with CloudLinux in Plesk

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

Managing PHP extensions with CloudLinux in Plesk

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

Enabling the Mailparse extension with CloudLinux in Plesk

Mailparse helps PHP software inspect MIME email messages and attachments. A helpdesk, mail...