Mac brew 升级 php7.2 并设置为默认

mac 升级PHP 到 7.2

whereis php 
php -v

 

系统默认自带的是 PHP5.6,需要升级到最新版本 PHP7.2

 

brew install php72
brew info php72
brew --prefix php

 


中途可能要升级 xcode-select

修改 ~/.bash_profile

user:~ sl$ cat ~/.bash_profile 

# The original version is saved in .bash_profile.pysave
PATH="$(brew --prefix php)/bin:$PATH"
export PYTHON_ENV=development

user:~ sl$ source ~/.bash_profile 
user:~ sl$ php -v
user:~ sl$ php -v
PHP 7.2.9 (cli) (built: Aug 23 2018 02:10:05) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.9, Copyright (c) 1999-2018, by Zend Technologies
user:~ sl$ 

————————————————
版权声明:本文为CSDN博主「用户昵称不能为空」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/default7/article/details/82287741

posted @ 2019-12-06 15:46  php小小菜鸟  阅读(3160)  评论(0编辑  收藏  举报