first step:
brew install php71 --with=apache
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew unlink php56
brew install php71 —with=apache
Step 2:
If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
~/.zshrc, ~/.profile or your shell's equivalent configuration file:
export PATH="$(brew --prefix homebrew/php/php71)/bin:$PATH"
third step:
Add the following to http.conf under /usr/local/etc/apache2/2.4/:
LoadModule php7_module /usr/local/Cellar/php71/7.1.0-rc.5_9/libexec/apache2/libphp7.so
<FilesMatch .php$>
SetHandler application/x-httpd-php
</FilesMatch>
<IfModule unixd_module>
Part 4: Install mysql.
The installation package is: mysql-5.7.16-osx10.11-x86_64.dmg
After installation, the following prompt will appear:
2016-11-09T08:30:02.879012Z 1 [Note] A temporary password is generated for root@localhost: mmf4uk>k>&wG
If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
Record the password automatically generated by the installation package: mmf4uk>k>&wG
。
Under /usr/local/myql/bin, log in to the terminal via ./mysql –uroot –p:
During the operation, it is found that the password needs to be changed. The command is as follows: SET PASSWORD = PASSWORD('projectx2015');
Because mysql is installed through pkg, there is no need to automatically update the path, so you need to manually update the path.
Add in ~/.bashrc
export PATH="/usr/local/mysql/bin:$PATH"
Then execute: source .bashrc.