Ubuntu Centos 等Linux 平台不妨运用以次吩咐来安置composer:

# php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"

# php composer-setup.php

All settings correct for using Composer

Downloading...

Composer (version 1.6.5) successfully installed to: /root/composer.phar

Use it: php composer.phar

挪动 composer.phar,如许 composer 就不妨举行全部挪用:

# mv composer.phar /usr/local/bin/composer

切换为海内镜像:

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

革新 composer:

# composer selfupdate