mac 安装php7

如果之前安装过,卸载


$ brew uninstall php70

安装

$ 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

apache中修改

LoadModule php5_module libexec/apache2/libphp5.so

LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so

SetHandler application/x-httpd-php

你可能感兴趣的:(mac 安装php7)