1.安装包管理工具homebrew ,相当于ubuntu的apt-get
在iTerm命令行输入:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.安装PHP7.1
brew install homebrew/php/php71
开机自启
brew services start homebrew/php/php71
3.安装mysql
brew install mysql //开机自启 brew services start mysql
4.安装composer
见之前文章:Linux下全局安装composer方法
5.下载laravel项目
composer create-project laravel/laravel project-name --prefer-dist "5.5.*"
6.启动laravel
php artisan serve
成功!