关于php:Mac下软件管理工具brew更换国内源及常用命令

更换国内源:官网链接

cd "$(brew --repo)"
 
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
 
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
 
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
 
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile'

source ~/.bash_profile

装置多个版本软件,例如php

brew install php@7.4
brew install php   // 默认装置php8
brew link --overwrite php@7.4 //切换版本

查找软件

brew update
brew search xxx

查看软件装置状况

brew info xxx

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理