【发布时间】:2020-01-24 18:23:27
【问题描述】:
我正在尝试通过 Composer 在 Magento 2 上安装扩展,但是当我运行 Composer 更新时,我收到以下错误:
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
我尝试:
php -d memory_limit=-1 composer update
但我得到:
Could not open input file: composer
所以我尝试并得到了:
curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...
Composer (version 1.9.0) successfully installed to: /home/customer/www/xxx/public_html/composer.phar
Use it: php composer.phar
所以,我认为它已修复,我再次尝试并得到:
php -d memory_limit=-1 composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
所以我再次尝试作曲家更新并得到:
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
再一次,我尝试composer update 并得到
Could not open input file: composer
我又回到了我开始的地方并且非常困惑:/请告知。谢谢。
【问题讨论】:
-
您达到了大约 2GB 的内存限制。您使用的是 32 位 PHP 吗?通常 Composer 会尝试自己管理它的内存限制,但我假设 Magento 正在创建巨大的依赖关系图。
标签: composer-php magento2