# php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"# php composer-setup.php# mv composer.phar /usr/local/bin/composer
php composer-setup.php —help 查看文档
Composer Installer------------------Options--help this help--check for checking environment only--force forces the installation--ansi force ANSI color output--no-ansi disable ANSI color output--quiet do not output unimportant messages--install-dir="..." accepts a target installation directory--preview install the latest version from the preview (alpha/beta/rc) channel instead of stable--snapshot install the latest version from the snapshot (dev builds) channel instead of stable--1 install the latest stable Composer 1.x version--2 install the latest stable Composer 2.x version--version="..." accepts a specific version to install instead of the latest--filename="..." accepts a target filename (default: composer.phar)--disable-tls disable SSL/TLS security for file downloads--cafile="..." accepts a path to a Certificate Authority (CA) certificate file for SSL/TLS verification
composer 升级
当前composer更新为最新版
composer self-update
更新到指定版本
composer self-update 1.10.1
回滚到安装的上一个版本
composer self-update -r#退回上个大版本composer self-update -1
切换为国内镜像:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
