如果之前安装过,卸载
<pre>
$ brew uninstall php70
</pre>
安装
<pre>
$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap homebrew/homebrew-php
//安装PHP7
$ brew install php70 --with-httpd24 --with-homebrew-curl --build-from-source
$ brew unlink php70
$ brew link php70
$ php -v
PHP 7.0.14 (cli) (built: Jan 20 2017 15:46:57) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
</pre>
apache中修改
<pre>
LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so
<FilesMatch .php$>
SetHandler application/x-httpd-php
</FilesMatch>
</pre>