For composer require
and composer install
, composer update
we know everything, official servers in foreign countries, leading to the need to pull when the package very, very slow.
It is usually output like this, followed by endless waiting:
composer command with -vvv
First of all, it is recommended composer
to bring -vvv
parameters when using the command . This can output more detailed information, let you know where you are stuck, and troubleshoot the problem purposefully.
Generally, the speed can be improved by replacing the domestic mirror or using an agent to operate composer
.
Replace the domestic mirror
PHP Composer
full mirroring of major cloud vendors , plus previous full mirroring resources:
Ali Cloud
Instructions for use: https://mirrors.aliyun.com/composer/
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
Bash
HUAWEI CLOUD
composer config -g repo.packagist composer https://mirrors.huaweicloud.com/repository/php/
Bash
Tencent Cloud
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/
Bash
cnpkg
composer config -g repos.packagist composer https://php.cnpkg.org](https://php.cnpkg.org
You can see where each step is stuck and where the installation is: