Solve the problem of slow installation of composer

For composer requireand composer install, composer updatewe 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 composerto bring -vvvparameters 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 Composerfull 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:

 

Guess you like

Origin blog.csdn.net/lchmyhua88/article/details/105464910