Composer 更新显示此错误:VirtualAlloc() failed: [0x00000008] [英] Composer update show this error: VirtualAlloc() failed: [0x00000008]
问题描述
Composer 昨天找到了,但今天在我尝试安装后:作曲家需要 --prefer-dist himiklab/yii2-recaptcha-widget"*"
Composer worked find yesterday, but today after I trying install: composer require --prefer-dist "himiklab/yii2-recaptcha-widget" "*"
运行 composer update 命令时,它显示错误:
While run composer update command it show me error:
VirtualAlloc() 失败:[0x00000008] VirtualAlloc() 失败:[0x00000008] PHP致命错误:内存不足(分配956301312)(试图分配 201326600 字节)在phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSet.php在第 84 行
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
致命错误:内存不足(已分配 956301312)(试图分配201326600 字节)在phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleSet.php在第 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
我尝试在我的其他项目上更新作曲家,效果很好.经过一番研究,我在 php.ini 文件中增加了 memory_limit: 4096M(also -1) .然后我尝试在计算机->属性中增加虚拟内存,但仍然显示错误.
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.
我尝试运行下一个命令:composer update -vvv --profile,结果附加图像作曲错误
I try to run next command: composer update -vvv --profile, result in attached image Composer error
任何帮助将不胜感激.
推荐答案
您可能正在使用 32 位 PHP.即使将 memory_limit 更改为 -1(无限制),此版本也无法为 composer 分配足够的内存.
You are probably using 32bit PHP. This version cannot allocate enough memory for composer even if you change the memory_limit to -1 (unlimited).
请使用 64 位 PHP 和 Composer 来解决这些内存问题.
Please use 64 bit PHP with the Composer to get rid of these memory problems.
这篇关于Composer 更新显示此错误:VirtualAlloc() failed: [0x00000008]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!