1、下載composer
curl -sS https://getcomposer.org/installer | php
2、將composer.phar文件移動到bin目錄以便全局使用composer命令
mv composer.phar /usr/local/bin/composer
3、切換國內源
composer config -g repo.packagist composer https://packagist.phpcomposer.com
4、輸入composer驗證:
安裝成功!