Composer安装

  • 安装
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'bf16ac69bd8b807bc6e4499b28968ee87456e29a3894767b60c2d4dafa3d10d045ffef2aeb2e78827fa5f024fbe93ca2') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
  • 当前文件夹下使用
php composer.phar
  • 全局使用
sudo mv composer.phar /usr/local/bin/composer
  • 国内镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com

你可能感兴趣的:(Composer安装)