LoginSignup
9
10

More than 5 years have passed since last update.

PHP7.2インストールメモ for Mac(Homebrew使用)

Last updated at Posted at 2015-01-15

Homebrewインストール

1. Homebrewインストール

手順は公式サイトを参照
https://brew.sh/index_ja

2. Homebrewの更新


$ brew update
$ brew upgrade

3. 環境チェック

「brew doctor」実行時に表示されるwarningを解決しておく


$ brew doctor
Your system is ready to brew.

4. 環境変数設定(.bash_profileにPATH設定を追加)


$ cat > ~/.bash_profile <<EOF
> export PATH=/usr/local/bin:$PATH
> export PATH=/usr/local/sbin:$PATH
> EOF

5. Gitをインストール


$ brew install git

PHPインストール

1. HomebrewでPHPをインストール


$ brew install php@7.2

2. php.iniの設定変更

「/usr/local/etc/php/7.2/php.ini」を必要に応じて編集


date.timezone = Asia/Tokyo
default_charset = "UTF-8"
mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
mbstring.detect_order = UTF-8,SJIS,EUC-JP,JIS,ASCII

3. バージョン確認


$ php -v
9
10
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
9
10