Allowed memory size of X bytes exhausted error in Plesk | Solution

Allowed memory size of X bytes exhausted error in Plesk can be resolved with this easy tip by our in-house experts.

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team is ready to help customers with modifying memory_limit value in Plesk.

How to resolve: Allowed memory size of X bytes exhausted error in Plesk

Plesk is a user-friendly web hosting control panel that focuses on web security. It works as an intermediary between users and system services. Furthermore, it administers system services via a single web interface, thereby reducing maintenance costs and also offering administrators more control as well as flexibility.

Plesk allows hosting service providers to organize server resources into separate packages and then offer these packages to companies, organizations, individuals, and so on.

Unfortunately, Plesk is still prone to errors every now and then. However, with our skilled Support Engineers by your side, you no longer have to worry. One specific error that has come to light recently is the Allowed memory size of X bytes exhausted error in Plesk.

This error often pops up while updating or installing Composer in Plesk via a CLI. It results in the following error message:

PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes) 
in phar:///usr/lib/plesk-9.0/composer.phar/src/Composer/DependencyResolver/Rule2Literals.php on line 48

As the error message suggests, the reason behind the error is the insufficient memory limit for the Composer update. Our Support Team is here with a solution:

  1. First, we will log in to Plesk.
  2. Then, we have to navigate to Domains > example.com > PHP Composer > Environment variables.
  3. Next, we will click Specify seen under Environment variables.
  4. After that, we have to add the environment variable seen below:
    memory_limit = 2048M

    Allowed memory size of X bytes exhausted error in Plesk

    We can also set it to -1 in order to make it unlimited.

    In case the command fails, resulting in the same error message, our Support Techs recommend increasing the memory_limit value or using the following variable instead:

    COMPOSER_MEMORY_LIMIT = 2048M

We can also resolve the error via the command line by running the following command after connecting to the Plesk server via SSH:

# /opt/plesk/php/7.2/bin/php -d memory_limit=2048M /usr/lib/plesk-9.0/composer.phar update

In case the command does not succeed, our Support Team suggests increasing the memory_limit value.

[Looking for a solution to another query? We are just a click away.]

Conclusion

To sum up, our skilled Support Engineers at Bobcares demonstrated how to modify memory_limit value in Plesk.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED