LoginSignup
51
47

More than 5 years have passed since last update.

MacにHomebrewでPHP5.5をインストールした時のメモ

Last updated at Posted at 2013-10-03

参考にしたサイト
http://diary.renallery.net/post/60366723637

# リポジトリを追加
brew tap homebrew/dupes
brew tap josegonzalez/php

# インストールオプションや依存するパッケージを確認
brew info php55

# インストール 
# ※依存するパッケージも同時にインストールされる
# ※IDEでのPHPの実行環境として使いたいだけなので、
#  とりあえずオプションを指定せずにインストールする
brew install php55

# 
# インストール完了
#

# バージョンを確認
php -v
--
PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 24 2012 17:45:44) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
--

# あれ!?

# PHPのパスを確認
which php
--
/usr/bin/php
--

# ↑ MacにデフォルトでインストールされているPHPのパスを指しているので
# 今回入れたPHP5.5を指すようにPATHを追加
echo 'export PATH=$(brew --prefix)/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

# パスを確認 ->OK
which php
--
/usr/local/bin/php
--

# 実際はシンボリックリンクになってる
# ls -l /usr/local/bin/php
# --
# /usr/local/bin/php -> ../Cellar/php55/5.5.4/bin/php
# --

# バージョンを確認 ->OK
php -v
--
PHP 5.5.4 (cli) (built: Oct  2 2013 00:47:14) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
--

無事インストールできました(∩´∀`)∩

MacデフォルトのPHPのアンインストール方法も調べたい。。。

51
47
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
51
47