php 在docker 中使用composer 报内存溢出的解决方法

2021-02-01 20:13

阅读:495

标签:oca   inf   fatal   orm   gpu   details   including   json   trie   

最近 需要用到有盟的推送,不想自己写,准备在github上面找个来改改,本地用的环境是docker 镜像,然后在docker 中 composer 时的时候,报了一个错

 docker exec -it www /bin/bash



root@85c8ee9b5e27:/var/www/html/newyouchengdu# composer require lzg-xiyi/umengpush
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^1.0 for lzg-xiyi/umengpush
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

这个很明显的内存溢出错,怎么办,肯定 是改不限制内存

https://stackoverflow.com/questions/49212475/composer-require-runs-out-of-memory-php-fatal-error-allowed-memory-size-of-161

然后找到了解决方案

root@85c8ee9b5e27:/var/www/html/newyouchengdu# php -d memory_limit=-1 /usr/local/bin/composer require lzg-xiyi/umengpush -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid

 

php 在docker 中使用composer 报内存溢出的解决方法

标签:oca   inf   fatal   orm   gpu   details   including   json   trie   

原文地址:https://www.cnblogs.com/jackluo/p/13178092.html


评论


亲,登录后才可以留言!