LoginSignup
0
1

More than 5 years have passed since last update.

[PHP]MacにhomebrewでComposerをインストールしよう。

Posted at

composer.png
PHPを扱うものとしてはComposerは必須ですよね。
homebrewでのインストール方法を簡単ですがまとめました。

+Composerって?

PHPのパッケージ管理ツールのことです。
CakePHPやLaravelなどのフレームワークであったり、Githubなどで公開されている便利なパッケージ(メール操作・ファイル操作など)を一元管理してくれます。
違う環境で作業を行うときなど、コマンドを叩くだけですべてのパッケージを一括でインストールできます。

+事前準備

  • パソコン
  • PHP:バージョン5.3.2以上 ※MAMPでサクッとインストールした方が簡単。

※ PHPのインストール確認
1.Macのターミナル or Windowsのコマンドプロンプトを立上げる。
2.以下のコマンドを入力する。

$ php -v

3.こんな感じでバージョンが表示されるとOK。

PHP 7.1.12 (cli) (built: Nov 27 2017 15:53:40) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

+インストール

1.homebrewでComposerを検索する。

$ brew search composer

こんな感じで表示されればOKです。

==> Formulae
composer

2.インストール用コマンドを入力

$ brew install composer

以上でインストールは完了です。

+確認

1.composerコマンドを入力

$ composer

2.こんな感じでバージョンが表示されるとOK。

   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.6.5 2018-05-04 11:44:59
Usage:
  command [options] [arguments]
0
1
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
1