Composer Update failed — out of memory

后端 未结 25 2568
再見小時候
再見小時候 2020-12-01 00:40

I got this error when running composer.phar update on my VM:

PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried t

25条回答
  •  北海茫月
    2020-12-01 01:05

    I'm on a Windows machine and I tried all of the answers from this question, but none of them worked. For me, it FINALLY worked after I ran composer using the 64-bit version of PHP.

    To run composer using a local copy of PHP x64 you can do the following:

    1. Download the zip file from here (I used the VC15 x64 Thread Safe version): https://windows.php.net/download
    2. Unzip the file
    3. Copy php.ini-development and rename to php.ini
    4. Uncomment the extension_dir = "ext" line and any other php extensions you will need (such as extension=gd2 or extension=openssl). If any other PHP extensions are needed for the update then it will tell you while running the command.

    Working command:

    "C:\path\to\php-7.2.23-Win32-VC15-x64\php.exe" -d memory_limit=-1 "C:/path/to/composer.phar" update
    

    Source: https://ourcodeworld.com/articles/read/816/how-to-solve-composer-install-update-error-virtualalloc-failed-0x00000008

提交回复
热议问题