1. 设置第三方仓库

      1. brew tap shivammathur/php
    2. 安装

      1. brew install shivammathur/php/php@7.2
    3. 链接

      1. brew link --overwrite --force shivammathur/php/php@7.2
    4. 安装完成后位置

      1. # php 配置
      2. /usr/local/etc/php/7.2/
      3. # php 命令
      4. /usr/local/Cellar/php@7.2/7.2.34_4.reinstall/bin
      5. # 环境变量配置
      6. export PATH="/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/bin:$PATH"
      7. export PATH="/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/sbin:$PATH"
      8. export LDFLAGS="-L/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/lib"
      9. export CPPFLAGS="-I/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/include"
    5. 重启 ``` brew services restart shivammathur/php/php@7.2

    /usr/local/opt/php@7.2/sbin/php-fpm —nodaemonize

    1. 6. nginx

    ==> nginx Docroot is: /usr/local/var/www

    The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that nginx can run without sudo.

    nginx will load all files in /usr/local/etc/nginx/servers/.

    To restart nginx after an upgrade: brew services restart nginx Or, if you don’t want/need a background service you can just run: /usr/local/opt/nginx/bin/nginx -g daemon off; ```