Mac自带php5.6版本,要升级到php7.3 步骤如下
1,brew 安装php ,如果没有安装,访问https://brew.sh/index_zh-cn安装
在终端输入以下内容,不用指定安装php版本,会自动升级到最新版本,同时brew会自动update
brew install php
2,php -v
PHP 7.3.0 (cli) (built: Dec 7 2018 11:01:10) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.0, Copyright (c) 1999-2018, by Zend Technologies
Mac上自带了Apache
1,查看版本
sudo apachectl -v
Server version: Apache/2.4.33 (Unix)
Server built: Apr 3 2018 17:54:07
//开启
sudo apachectl start
//停止
sudo apachectl stop
//重启
sudo apachectl -k restart
原文:https://www.cnblogs.com/peteremperor/p/10165987.html