#进入安装目录 cd /usr/local/bin #下载并安装 sudo curl -s https://getcomposer.org/installer | sudo php #添加执行权限 sudo chmod a+x composer.phar #加入全局命令 mv composer.phar /usr/local/bin/composer #查看版本号 composer --version