千家信息网

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

发表于:2025-01-24 作者:千家信息网编辑
千家信息网最后更新 2025年01月24日,本篇内容主要讲解"如何解决composer执行命令提示已杀死问题",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"如何解决composer执行命令提示已杀死问
千家信息网最后更新 2025年01月24日如何解决composer执行命令提示已杀死问题

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

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

具体问题:

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

composer require voku/simple_html_dom -vvvReading ./composer.jsonLoading config file ./composer.jsonChecked CA file /etc/pki/tls/certs/ca-bundle.crt: validFailed to initialize global composer: Composer could not find the config file: /home/admin/.composer/composer.jsonTo initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" sectionReading /home/wwwroot/vendor/composer/installed.jsonLoading plugin EasyWeChatComposer\PluginLoading plugin think\composer\PluginRunning 1.7.2 (2018-08-16 16:57:12) with PHP 7.1.18 on Linux / 2.6.32-696.16.1.el6.x86_64Downloading https://repo.packagist.org/packages.jsonWriting /home/admin/.composer/cache/repo/https---repo.packagist.org/packages.json into cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-01.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-04.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-07.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cacheDownloading http://repo.packagist.org/p/provider-latest%24502b160e3dcbe13f8c125df618d18632ebbad2402f1e07d96e00bf46c3da14ac.jsonWriting /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json into cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-voku$simple-html-dom.json from cacheUsing version ^4.7 for voku/simple_html_dom./composer.json has been updatedReading ./composer.jsonLoading config file ./composer.jsonFailed to initialize global composer: Composer could not find the config file: /home/admin/.composer/composer.jsonTo initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" sectionReading /home/wwwroot/vendor/composer/installed.jsonLoading plugin EasyWeChatComposer\Plugin_composer_tmp0Loading plugin think\composer\Plugin_composer_tmp1Reading ./composer.lockLoading composer repositories with package informationDownloading https://repo.packagist.org/packages.jsonWriting /home/admin/.composer/cache/repo/https---repo.packagist.org/packages.json into cacheUpdating dependencies (including require-dev)Reading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-01.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-04.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-07.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-10.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-adbario$php-dot-notation.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-clagiordano$weblibs-configmanager.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-danielstjules$stringy.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-guzzlehttp$guzzle.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-mtdowling$jmespath.php.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-alibabacloud$client.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-symfony$polyfill-mbstring.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-guzzlehttp$psr7.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-guzzlehttp$promises.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-psr$http-message.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-ralouphie$getallheaders.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-aliyuncs$oss-sdk-php.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-doctrine$cache.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-easywechat-composer$easywechat-composer.json from cacheReading /home/admin/.composer/cache/repo/https---repo.packagist.org/provider-symfony$options-resolver.json from cache

解决办法:

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

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

参考如下:

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

free -mmkdir -p /var/_swap_cd /var/_swap_#Here, 1M * 2000 ~= 2GB of swap memorydd if=/dev/zero of=swapfile bs=1M count=2000mkswap swapfileswapon swapfileecho "/var/_swap_/swapfile none swap sw 0 0" >> /etc/fstab#cat /proc/meminfofree -m

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

0