一、安装 Composer
Composer 官网 https://getcomposer.org/
安装方式1:
curl -sS https://getcomposer.org/installer | php
安装方式2:
php -r "readfile('https://getcomposer.org/installer');" | php
中国全量镜像 https://www.phpcomposer.com/
安装方式3:
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
二、镜像地址
1.Packagist(默认)
1.恢复默认镜像地址:
composer config -g --unset repos.packagist
2.手动设回默认镜像:
composer config -g repo.packagist composer https://repo.packagist.org
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer
composer config -g repo.packagist composer https://mirrors.cloud.tencent.com/composer/
4.华为开源镜像站
composer config -g repo.packagist composer https://mirrors.huaweicloud.com/repository/php/
5.中国全量镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com
6.SJTUG 软件源镜像服务(上海交通大学)
composer config -g repo.packagist composer https://packagist.mirrors.sjtug.sjtu.edu.cn