docker部署php项目内存溢出,php 在docker 中使用composer 报内存溢出的解决方法

标签: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 Composeras 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 of1610612736 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 of1610612736 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 configfile ./composer.json

Checked CAfile /etc/ssl/certs/ca-certificates.crt: valid

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值