準備工作
1. 安裝 安裝brew命令
#很慢很慢。。
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
替換國內源:
#下載腳本
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
#替換國內源
BREW_REPO = “https://github.com/Homebrew/brew“.freeze
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze
#執行
chmod 777 brew_install
./brew_install
安裝PHP環境
1.Nginx
• 安裝nginx brew install nginx
• 啓動nginx sudo nginx
• 訪問 http://localhost:8080/
2.安裝php
- 蘋果是自帶PHP的,如果不是要的版本可以安裝其他版本再切換
- 安裝PHP
brew install php72
- 直接安裝7.2然後切換版本(推薦)
brew link [email protected] --force --overwrite
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.bash_profile
- 查看php.ini目錄
php --ini
php -v
php -m
3.安裝mysql
brew install mysql56
4.更換composer源
最近換了mac好多的用不習慣安裝了composer但是下載不了laravel.
執行以下命令再下載laravel
sudo composer config -g repo.packagist composer https://packagist.phpcomposer.com
Go
1.Go編譯器安裝
- 官網下載安裝包,比較快
brew install go
- 添加環境變量
//編輯~/.bash_profile文件
vim ~/.bash_profile
//在~/.bash_profile文件中添加以下2條命令
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
//使配置生效
localhost:~ zxy$ source ~/.bash_profile
2.Goland的配置
參考:https://blog.csdn.net/zxy_666/article/details/80182688
核心步驟:
其他軟件
1.抓包破解
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
2.phpStrom
漢化:
點擊應用程序–>右擊PhpStorm選擇顯示包內容–>Contents–>lib