安装完成后提示:请按照提示添加相关环境变量。类似下述代码。
php@7.1 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have php@7.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/php@7.1/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/php@7.1/sbin:$PATH"' >> ~/.zshrc
For compilers to find php@7.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/php@7.1/lib"
export CPPFLAGS="-I/usr/local/opt/php@7.1/include"
To have launchd start exolnet/deprecated/php@7.1 now and restart at login:
brew services start exolnet/deprecated/php@7.1
Or, if you don't want/need a background service you can just run:
php-fpmphp -v 看看版本吧。如果版本没变,重启下你的terminal。
如何切换版本