php

composer查看全局配置

2023-09-18

composer查看全局配置:

composer config -l -g


使用 Composer 镜像加速有两种选项:


选项一:全局配置,这样所有项目都能惠及(推荐);

选项二:单独项目配置;

选项一、全局配置(推荐)


composer config -g repo.packagist composer https://packagist.laravel-china.org

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


选项二、单独使用

如果仅限当前工程使用镜像,去掉 -g 即可,如下:

$ composer config repo.packagist composer https://packagist.laravel-china.org


更换composer镜像源,可以执行尝试以下几种:

1、更换成阿里镜像:

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


2、更换成Laravel China镜像:

composer config -g repo.packagist composer https://packagist.laravel-china.org


3、更换成中国全量镜像:

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