安装 Composer
wget https://dl.laravel-china.org/composer.phar -O /usr/local/bin/composer chmod a+x /usr/local/bin/composer
Composer 镜像加速
一、全局配置
composer config -g repo.packagist composer https://packagist.laravel-china.org
二、局部配置(仅限当前工程使用镜像,去掉 -g 即可)
composer config repo.packagist composer https://packagist.laravel-china.org
全局配置信息查看, [repositories.packagist.org.url] 表示当前镜像地址
composer config -gl
取消镜像
composer config -g --unset repos.packagist
查看当前 composer 版本
composer -v
升级 composer 版本
composer selfupdate
以上就是Linux Composer安装,配置国内镜像的详细内容,更多请关注php中文网其它相关文章!
声明:本文转载于:segmentfault,如有侵犯,请联系admin@php.cn删除
上一篇:解决composer.phar安装问题 下一篇:分享 composer 小技巧