Pages

Wednesday, 29 June 2022

PHP Composer在国内的镜像源汇总

 各大云服务厂商逐渐公布了自己的 PHP Composer 全量镜像,整理以下『全量镜像』供大家选择。

PHP Composer 安装

1
2
3
4
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer

阿里云

自用稳定性很好,个人目前选择。

1
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

腾讯云

1
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/

phpcomposer

国内很早开放的免费镜像服务,其他服务商跟进之前的首选。

1
composer config -g repo.packagist composer https://packagist.phpcomposer.com
 

华为云

1
composer config -g repo.packagist composer https://mirrors.huaweicloud.com/repository/php/

安畅网络

1
composer config -g repos.packagist composer https://php.cnpkg.org

关闭全局配置

1
composer config -g --unset repos.packagist

多线程下载

1
2
composer global require hirak/prestissimo
composer clearcache
 

No comments:

Post a Comment