| First, join homebrew's official software source
$ brew Tap homebrew/dupes$ Brew tap homebrew/versions$ brew tap homebrew/php
| Install PHP5.6
$ Brew Install PHP56
新问题:安装完成后没有Apache用的php5.so
- Uninstall: Brew Remove php56-Install: Brew Install php56-with-Apache If the following description is deprecated Warning:homebrew--With-apache was deprecated; using--with-httpd24 instead! --with-httpd24
| Install Apache
$ brew Install HTTPD24 or brew install homebrew/apache/the HTTPD24 configuration file path is/usr/Local/etc/apache2/2.4/Httpd.confapache Support PHP1, loading module libphp5.so: General in/usr/Local/cellar/php56/5.6. +/libexec/apache2/libphp5.so2, suffix name<ifmodule php5_module>AddType Application/x-httpd-php. PHP addtype Application/x-httpd-php-source. Phps<ifmodule dir_module>directoryindex index.htm index.html index.php</IfModule></IfModule>
| install MySQL
$ brew Install mysqlwe ' ve installed your MySQL database without a root password. To secure it run: mysql_secure_installationto Connect run: -Urootto has launchd start MySQL At login: -sfv/usr/local/opt/mysql/*.plist ~/library/load mysql now: load ~/library/launchagents/if you don't want/need launchctl, you Can just run: mysql.server Start
Add modify MySQL Configuration
-- Help---verbose | More (view assistance, press space to flip) in the given order:/etc/my.cnf/etc/mysql/my.cnf/usr/local/etc/my.cnf ~/ --prefix mysql)/support-files/my-* (use this to find a sample. cnf)/usr/local/opt/ mysql/support-files/my-default.cnf/etc//usr/local/etc/my.cnf (Lest Mac system upgrade may be lost) modify MY.CNF as needed and restart MySQL
MAC Brew Installation AMP Environment