1 阿里云 Composer 镜像
全局配置(推荐)
所有项目都会使用该镜像地址:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
取消配置:
composer config -g --unset repos.packagist
项目配置
仅修改当前工程配置,仅当前工程可使用该镜像地址:
composer config repo.packagist composer https://mirrors.aliyun.com/composer/
取消配置:
composer config --unset repos.packagist
调试
composer 命令增加 -vvv 可输出详细的信息,命令如下:
composer -vvv require alibabacloud/sdk
2 腾讯 Composer 镜像
切换镜像指向:
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/
Composer 安装简明教程
一、下载安装脚本,如下方式任选一种即可:
1、php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
2、curl -sS https://install.phpcomposer.com/installer | php
二、执行安装:
php composer-setup.php
三、完成安装:
mv composer.phar /usr/local/bin/composer