LoginSignup
1
2

More than 5 years have passed since last update.

macOS(Mojave)にphp7.2をインストールする

Last updated at Posted at 2019-02-21

お久しぶりです!
二ヶ月後にエンジニアとして本格デビューする和尚です。

最近は入社が決まった会社の事前課題でlaravelをカリカリと書いている毎日。。。

そんなことは置いておいて、macOSにphp@7.2をbrewを使ってインストールしていきます:fist:

環境

  • macOS Mojave バージョン10.14
  • php 7.1.19 (元々入っていたphp)

インストール

brewからphpの7.2を探す

$ brew search php72
==> Formulae
php@7.2

brewでインストールする

$ brew install php@7.2

PATHを通す

$ 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のバージョンを確認する。

$ php -v
PHP 7.2.15 (cli) (built: Feb  7 2019 20:10:03) ( NTS )

おまけ

composerをインストールする

$brew search composer
==> Formulae
composer

$brew install composer

終わりです^^

1
2
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
1
2