Install Linux Composer and configure domestic mirroring

藏色散人
Release: 2019-09-06 13:46:34
forward
2700 people have browsed it

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 column composer usage tutorial will 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
Copy after login

Composer image acceleration

1. Global configuration

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

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

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

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

composer config -gl
Copy after login

Cancel mirroring

composer config -g --unset repos.packagist
Copy after login

View the current composer version

composer -v
Copy after login

Upgrade the composer version

composer selfupdate
Copy after login

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template