我的VPS使用CyberPanel的CentOs 7,当我试图使用 composer install
我得到这个错误
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 268435456 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 268435456 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
有什么想法吗?
找到正确的 php.ini
使用以下命令为你的PHP CLI SAPI添加。
php -i | grep 'ini'
添加 memory_limit = -1
用文本编辑器将其添加到这个文件中。
你也可以用......或......来增加一个命令的内存限制。
COMPOSER_MEMORY_LIMIT=-1 composer update
...或...
php -d memory_limit=-1 /user/bin/composer update
我使用这个命令,我的作曲家开始执行
which composer
要找到我的作曲家之路,然后
php -d memory_limit=-1 /user/bin/composer update