composer安装以及镜像源

安装composer建议参考composer官网安装方式,网址如下:https://pkg.phpcomposer.com/#how-to-install-composer

1.查看镜像源
系统全局配置:
可以使用 composer config -l -g 查看所有全局配置

单个项目配置:
在当前项目根目录可以使用 composer config -l 查看当前项目镜像配置

2.修改阿里淘宝镜像源
(1). 配置只在当前项目生效
composer config repo.packagist composer https://mirrors.aliyun.com/composer/
取消当前项目配置
composer config --unset repos.packagist

(2)配置全局生效
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
取消全局配置
composer config -g --unset repos.packagist

3.composer 的各类镜像源

      composer        https://packagist.org
      phpcomposer     https://packagist.phpcomposer.com
      aliyun          https://mirrors.aliyun.com/composer
      tencent         https://mirrors.cloud.tencent.com/composer
      huawei          https://mirrors.huaweicloud.com/repository/php
      laravel-china   https://packagist.laravel-china.org
      cnpkg           https://php.cnpkg.org

你可能感兴趣的:(细说php入门学习)