Skip to main content

phpenv

curl -L -O https://github.com/phpbrew/phpbrew/releases/latest/download/phpbrew.phar
chmod +x phpbrew.phar

#
sudo mv phpbrew.phar /usr/local/bin/phpbrew


phpbrew init
# .bashrc
# [[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc

macOS brew

# 7.4, 8.0, 8.1
brew install php [email protected]

# 更多版本
brew tap shivammathur/php
brew install shivammathur/php/[email protected]

# 替换默认
brew unlink php && brew link --overwrite --force [email protected]