Home>Article>Development Tools> Install Linux Composer and configure domestic mirroring

Install Linux Composer and configure domestic mirroring

藏色散人
藏色散人 forward
2019-09-06 13:46:34 2599browse

Composer is a dependency management tool for PHP. It allows you to declare code libraries that your project depends on and it will install them for you in your project. The following columncomposer usage tutorialwill introduce to you how to install Linux Composer and configure domestic mirroring. I hope it will be helpful to friends in need!

Install Linux Composer and configure domestic mirroring

Install Composer

wget https://dl.laravel-china.org/composer.phar -O /usr/local/bin/composer chmod a+x /usr/local/bin/composer

Composer image acceleration

1. Global configuration

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

2. Local configuration (only Only the current project can use mirroring, just remove -g)

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

View global configuration information, [repositories.packagist.org.url] represents the current mirroring address

composer config -gl

Cancel mirroring

composer config -g --unset repos.packagist

View the current composer version

composer -v

Upgrade the composer version

composer selfupdate

The above is the detailed content of Install Linux Composer and configure domestic mirroring. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete