温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何解决composer执行命令提示已杀死问题

发布时间:2021-10-18 17:20:34 来源:亿速云 阅读:154 作者:iii 栏目:软件技术

本篇内容主要讲解“如何解决composer执行命令提示已杀死问题”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“如何解决composer执行命令提示已杀死问题”吧!

本文由composer教程栏目给大家介绍关于执行composer require 一会儿就提示“已杀死”问题,希望对需要的朋友有所帮助!

具体问题:

执行composer require 一会儿就提示“已杀死”

composer require voku/simple_html_dom -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/pki/tls/certs/ca-bundle.crt: valid
Failed to initialize global composer: Composer could not find the config file: /home/admin/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /home/wwwroot/vendor/composer/installed.json
Loading plugin EasyWeChatComposer\Plugin
Loading plugin think\composer\Plugin
Running 1.7.2 (2018-08-16 16:57:12) with PHP 7.1.18 on Linux / 2.6.32-696.16.1.el6.x86_64
Downloading https://repo.packagist.org/packages.json
Writing /home/admin/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-01.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-04.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-07.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cache
Downloading http://repo.packagist.org/p/provider-latest%24502b160e3dcbe13f8c125df618d18632ebbad2402f1e07d96e00bf46c3da14ac.json
Writing /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json into cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-voku$simple-html-dom.json from cache
Using version ^4.7 for voku/simple_html_dom
./composer.json has been updated
Reading ./composer.json
Loading config file ./composer.json
Failed to initialize global composer: Composer could not find the config file: /home/admin/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /home/wwwroot/vendor/composer/installed.json
Loading plugin EasyWeChatComposer\Plugin_composer_tmp0
Loading plugin think\composer\Plugin_composer_tmp1
Reading ./composer.lock
Loading composer repositories with package information
Downloading https://repo.packagist.org/packages.json
Writing /home/admin/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-01.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-04.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-07.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-adbario$php-dot-notation.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-clagiordano$weblibs-configmanager.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-danielstjules$stringy.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-guzzlehttp$guzzle.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-mtdowling$jmespath.php.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-alibabacloud$client.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-symfony$polyfill-mbstring.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-guzzlehttp$psr7.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-guzzlehttp$promises.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-psr$http-message.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-ralouphie$getallheaders.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-aliyuncs$oss-sdk-php.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-doctrine$cache.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-easywechat-composer$easywechat-composer.json from cache
Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-symfony$options-resolver.json from cache

解决办法:

一般是内存不足导致进程被杀死。

没办法增大物理内存的话可以考虑扩容 swap 分区。

参考如下:

composer 安装或者更新时报错killed ,因为当前内存不足。

free -m
mkdir -p /var/_swap_
cd /var/_swap_
#Here, 1M * 2000 ~= 2GB of swap memory
dd if=/dev/zero of=swapfile bs=1M count=2000
mkswap swapfile
swapon swapfile
echo “/var/_swap_/swapfile none swap sw 0 0” >> /etc/fstab
#cat /proc/meminfo
free -m

到此,相信大家对“如何解决composer执行命令提示已杀死问题”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI