mac配置laravel开发环境

1:安装iTerm2

iTerm2官网:http://www.iterm2.com/

2:安装brew

brew官网:http://brew.sh/

3:安装zsh

brew install zsh

4:安装oh-my-zsh

项目地址:https://github.com/robbyrussell/oh-my-zsh

5:安装PHP7.0x

brew install php70 --with-debug --with-gmp --with-homebrew-curl --with-homebrew-libressl --with-homebrew-libxml2 --with-homebrew-libxslt --with-imap --with-libmysql --with-mssql

替换mac自带的php:

echo'export PATH="$(brew --prefix php70)/bin:$PATH"'>> ~/.zshrc

echo'export PATH="$(brew --prefix php70)/sbin:$PATH"'>> ~/.zshrc

echo'export PATH="/usr/local/bin:/usr/local/sbib:$PATH"'>> ~/.zshrc

source~/.zshrc

6:安装composer

brew install composer

切换composer源:

composer config -g repo.packagist composer https://packagist.phpcomposer.com

将~/.composer/vendor/bin添加到zsh的.zshrc配置文件中:

cd ~

vi .zshrc

添加:

export PATH=".composer/vendor/bin:$HOME/.composer/vendor/bin:"

7:安装valet

composer global require laravel/valet

开启valet:

valet install

8:安装mysql

brew install mysql

9:安装laravel

composer global require "laravel/installer"

10:选定自定义目录,新建laravel项目

cd ~

mkdir Laravel

cd laravel

valet park

laravel new laravel-project

浏览器访问: laravel-project .dev

完。

你可能感兴趣的:(mac配置laravel开发环境)