---
title: "How to change the PHP memory limit for Composer commands"
date: "2022-01-28T00:40:02+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/94301-how-change-php-memory-limit-composer-commands"
id: "d0368818-b59e-4ce3-86af-a3ded022d725"
---

There is a [known issue with composer](https://docs.acquia.com/blt/developer/dev-workflow/#workflow-example-local-development) where when you try to use `composer require` or `composer update` you might see the following errors during local development in command line:

    PHP Fatal error: Allowed memory size of 1610712738 bytes exhausted (tried to allocate 4098 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 50 

Or

    $ composer update
    Loading composer repositories with package information
    Warning from https://packages.drupal.org/lenient: Careful, You are using the https://packages.drupal.org/lenient which ignores core version requirements for some projects. See https://www.drupal.org/composer/lenient for more information.
    Updating dependencies
    Killed

Resolution
----------

To override this and fix the issue on your local machine or Cloud IDE you can run your composer command like the following:

    $ COMPOSER_MEMORY_LIMIT=2Gb composer update

Or to have unlimited memory:

    $ COMPOSER_MEMORY_LIMIT=-1 composer update

If this did not help we recommend to modify the php.ini. [Read more](https://support.acquia.com/hc/en-us/articles/360036102614-Overriding-memory-limits-during-local-development-with-Composer)