«

composer 查看配置及设置源等操作命令总结

时间:2024-2-28 16:10     作者:韩俊     分类: PHP


1. 查看 composer 配置项:

composer config -g -l

composer config --list

2. 设置 composer 的源地址:

中国全量镜像

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

切换到国内源 阿里

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

切换到国内源 腾讯

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

解除镜像(还原)执行之后,composer 会利用默认值(也就是官方源)重置源地址。

composer config -g --unset repos.packagist

3. 执行命令设置 composer 超时时间

composer config -g process-timeout 600

4. 清除缓存

composer clear-cache

标签: php php教程

热门推荐