我的电脑里面预装的是5.6.x的版本,需要升级到最新的版本PHP7.x。其实升级很简单,网上都搞得好复杂。官网资料:https://php-osx.liip.ch/
1.升级到7.1:
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.1
2.配置路径信息:
vim ~/.bash_profile
export PATH=/usr/local/php5/bin:$PATH;
3.使配置生效:
source ~/.bash_profile
4.查询版本:php -v
PHP 7.1.4 (cli) (built: May 6 2017 10:02:00) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.4, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.3, Copyright (c) 2002-2017, by Derick Rethans