Homebrew 1.5 宣布放弃 homebrew/php, 转而使用homebrew/core维护, 详见https://brew.sh/2018/01/19/homebrew-1.5.0/
Today I’d like to announce Homebrew 1.6.0. The most significant changes since 1.5.0 are brew install python installing Python 3, the deprecation of Homebrew/php and various formula API deprecations.。
原来在Mac 下创建本地开发环境时,一直都是用的 brew,因为使用方便,既然没了,那以后要安装插件要如何安装呢?
安装 PHP 7.2 版本:
brew instal php@7.2------------------------------------------------------------- tony:~ zhangbingliang$ php -v PHP 7.2.11 (cli) (built: Oct 11 2018 16:24:11) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.11, Copyright (c) 1999-2018, by Zend Technologies
配置文件位于:/usr/local/etc/php/7.2/
要在Apache中启用PHP,请向httpd.conf添加以下内容,并且重启Apache:
LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
brew切换PHP版本:
由于我之前安装了PHP7.1,现在系统中有两个PHP版本,需要切换到最新的PHP7.2版本中
brew unlink php71 //之前版本 brew link php72 //现在版本
备注:homebrew/core库中扩展还很少, 找不到的扩展也通过pecl安装