LoginSignup
1
0

More than 5 years have passed since last update.

fish shell環境下でMacのPHPバージョンを上げる

Posted at

やること

Macに標準インストールされているPHPではなくHomebrewでPHPをインストールして、標準ではなくbrew経由で入れたPHPを動かす。今回はPHP7.3を入れます。
fish shell環境下だと.bashrcや.bash_profileには書かないらしい。

前提

Homebrewインストール済み

HomebrewでPHPをインストール

$ brew search php@7
$ brew install php@7.3

PHPのバージョン確認

$ php -v

7.3じゃなくて標準インストールされている方のバージョンが表示される...:thinking:
パスを確認する。

$ pwd php
-> /usr/bin/php

brewで入れた方を見るようにする。

fish_user_pathsを使う。こっちでも同じことやってました。

$ set -U fish_user_paths /usr/local/opt/php@7.3/bin/ $fish_user_paths

shellを再起動して

$ php -v
-> 7.3.x
1
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
1
0