0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ComposerをmacOS Sierra 10.12にインストールする

Last updated at Posted at 2019-05-06

##注意
公式サイトのスクリプトを使用してください。
https://getcomposer.org/download/

##インストール
###composer-setup.phpをコピーする(現在のディレクトリにcomposer-setup.phpが作成される)

input
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

###composer-setup.phpのハッシュ値を生成してファイルが改ざんされていないことを確かめる

input
php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
output
Installer verified

###composer-setup.phpを実行する(composer.pharが作成される)

input
php composer-setup.php
output
All settings correct for using Composer
Downloading...

Composer (version 1.8.5) successfully installed to: /Users/<ユーザー名>/composer.phar
Use it: php composer.phar

###composer-setup.phpを削除する

input
php -r "unlink('composer-setup.php');"

###composer.pharを/usr/local/bin/composerに移動させる

input
sudo mv composer.phar /usr/local/bin/composer

###動作確認

input
composer --version
output
Composer version 1.8.5 2019-04-09 17:46:47
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?