PHP开发环境搭建

开发环境搭建

根据自身情况直接装 mac 开发环境,或选用Valet或者Docker搭建

使用Valet

安装

  1. Homebrew, run ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Composer, run brew install composer
  3. Xcode Download from App Store
  4. run xcode-select --install
  5. run brew install homebrew/php/php70
  6. run brew install --HEAD homebrew/php/php70-memcached
  7. Valet, run composer global require laravel/valet, add ~/.composer/vendor/bin to $PATH, run valet install
  8. (optional if using local db) mariadb run brew install mariadb

配置

  1. mkdir ~/Sites && cd ~/Site && valet park
  2. valet domain app or valet domain your-sub-domain.xmxdev.com
  3. git clone https://github.com/wt1098078873/Blog_Hexo.git web
  4. cd web
  5. cp .env.example .env 配置.env
  6. composer install --no-scripts 安装PHP依赖库
  7. npm install 安装前端编译组件

运行

  1. (optional if using local db) run brew services start mariadb
  2. 打开 http://web.dev 来查看网站

使用Docker

  1. Docker
  2. LaraDock
  3. 参考Valet方式配置&运行

相关资料