//下载,记得php要安装openssl扩展
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
//执行
php composer-setup.php ;
//删除
php -r "unlink('composer-setup.php');"
//全局命令
sudo mv composer.phar /usr/local/bin/composer
//更新,记得要在root下可以执行.或者添加sudo
composer selfupdate
// 更换国内镜像源
composer config -g repo.packagist composer https://packagist.phpcomposer.com
网友评论