I try to install magento 2 via composer.

composer create-project --repository=https://repo.magento.com/ magento/project-community-edition .

But I get "out of memory". I have 16 GB RAM.

So I restarted windows and tried again directly after restart without any programs open, but it still throws this error.

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 64 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Rule2Literals.php on line 53

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

1 Answer 1


Try with this command

php -d memory_limit=-1 /usr/local/bin/composer create-project --repository=https://repo.magento.com/ magento/project-community-edition --ignore-platform-reqs .

usually the path of composer is here:


If you are having problems with composer path , run the command below to find which path is the composer :

which composer

In your case should be :

php -d memory_limit=-1 /c/ProgramData/ComposerSetup/bin/composer create-project --repository=repo.magento.com magento/project-community-edition --ignore-platform-reqs .

  • I guess composer does not work with windows. I get Could not open input file: C:/Program Files/Git/usr/local/bin/composer
    – Black
    Commented Jan 30, 2020 at 11:56
  • upgraded my answer Commented Jan 30, 2020 at 11:57
  • which composer shows /c/ProgramData/ComposerSetup/bin/composer
    – Black
    Commented Jan 30, 2020 at 11:57
  • try to replace this /usr/local/bin/composer with this /c/ProgramData/ComposerSetup/bin/composer Commented Jan 30, 2020 at 11:59
  • Im not sure where to find /usr/local/bin/composer
    – Black
    Commented Jan 30, 2020 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.