设置第三方仓库
brew tap shivammathur/php
安装
brew install shivammathur/php/php@7.2
链接
brew link --overwrite --force shivammathur/php/php@7.2
安装完成后位置
# php 配置
/usr/local/etc/php/7.2/
# php 命令
/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/bin
# 环境变量配置
export PATH="/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/bin:$PATH"
export PATH="/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/sbin:$PATH"
export LDFLAGS="-L/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/lib"
export CPPFLAGS="-I/usr/local/Cellar/php@7.2/7.2.34_4.reinstall/include"
重启 ``` brew services restart shivammathur/php/php@7.2
/usr/local/opt/php@7.2/sbin/php-fpm —nodaemonize
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; ```