LoginSignup
0
0

More than 5 years have passed since last update.

HomebrewでPHP7.2をインストールする

Last updated at Posted at 2019-03-27

Homebrewのインストール

コマンドラインを開いて下記を実行する。

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

実行できなければ、下記の公式ページを開いてコマンドを確認してください。
https://brew.sh/index_ja

PHP7.2をインストール

$ brew search php72

==> Formulae
php@7.2

パッケージ名がわかったので、インストールを実行

$ brew install php@7.2

インストールが終わったらパスを通します

$ echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile
$ echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
$ php -v

PHP 7.2.16 (cli) (built: Mar 22 2019 08:49:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.16, Copyright (c) 1999-2018, by Zend Technologies

以上になります。

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