使用 Homebrew

1
2
3
4
5
6
7
8
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php

## To see a list of available configuration options run
brew options php56

brew install php56

修改 httpd.conf

1
2
3
4
5
sudo vi /etc/apache2/httpd.conf

## ========================== ##
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
## ========================== ##

php.ini 位置

1
/usr/local/etc/php/5.6/php.ini

参考链接: https://ryanwinchester.ca/posts/install-php-5-6-in-osx-10-with-homebrew