1
votes

Composer worked find yesterday, but today after I trying install: composer require --prefer-dist "himiklab/yii2-recaptcha-widget" "*"

While run composer update command it show me error:

VirtualAlloc() failed: [0x00000008] VirtualAlloc() failed: [0x00000008] PHP Fatal error: Out of memory (allocated 956301312) (tried to allocate 201326600 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 84

Fatal error: Out of memory (allocated 956301312) (tried to allocate 201326600 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 84

I try update composer on my other projects, it is worked fine. After some researching I increased memory_limit: 4096M(also -1) in php.ini file. Then I tried to increase virtual memory in Computer->Properties, but still show error.

I try to run next command: composer update -vvv --profile, result in attached image Composer error

Any help would be greatly appreciated.

1
Which version of composer do you use?Nico Haase
Composer version 1.9.1Murat Kurbanov
Or just stop abusing RAM, just in case, for me it was a Virtual Machine that was eating all my memory and no matter how much config I throw at PHP it never let me run anything until I close everything and run just the clean composer and php artisan commands that I needed.Salem Megiddo

1 Answers

3
votes

You are probably using 32bit PHP. This version cannot allocate enough memory for composer even if you change the memory_limit to -1 (unlimited).

Please use 64 bit PHP with the Composer to get rid of these memory problems.