問題:
I am trying to add HWIOAuthBundle to my project by running the below command.我正在嘗試通過運行以下命令將 HWIOAuthBundle 添加到我的項目中。
composer require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle
HWIOAuthBundle github: https://github.com/hwi/HWIOAuthBundle HWIOAuthBundle github: https : //github.com/hwi/HWIOAuthBundle
When I try to run composer require I am getting the out of memory error.當我嘗試運行 composer require 時出現內存不足錯誤。
Using version ^0.6.0@dev for hwi/oauth-bundle Using version ^1.2@dev for php-http/guzzle6-adapter Using version ^1.10@dev for php-http/httplug-bundle ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)使用版本 ^0.6.0@dev for hwi/oauth-bundle 使用版本 ^1.2@dev for php-http/guzzle6-adapter 使用版本 ^1.10@dev for php-http/httplug-bundle ./composer.json 已更新使用包信息加載 Composer 存儲庫 更新依賴項(包括 require-dev)
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108864 bytes) in phar:///usr/local/Cellar/composer/1.4.2/libexec/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220 PHP 致命錯誤:在 phar:///usr/local/Cellar/composer/1.4.2/libexec/composer.phar/src/Composer/DependencyResolver/Solver 中,允許的內存大小爲 1610612736 字節(試圖分配 67108864 字節)。 php 在線 220
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 67108864 bytes) in phar:///usr/local/Cellar/composer/1.4.2/libexec/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220致命錯誤:在 phar:///usr/local/Cellar/composer/1.4.2/libexec/composer.phar/src/Composer/DependencyResolver/Solver.php 中允許的內存大小爲 1610612736 字節(試圖分配 67108864 字節)在線 220
I tried setting the memory_limit to 2G in my php.ini file but did not work.我嘗試在我的 php.ini 文件中將 memory_limit 設置爲 2G,但沒有奏效。 I found my php.ini by running php -i | grep php.ini
我通過運行php -i | grep php.ini
找到了我的 php.ini php -i | grep php.ini
解決方案:
參考一: https://en.stackoom.com/question/3KUPb參考二: https://stackoom.com/question/3KUPb