当前位置:网站首页>Mac Brew 安装PHP
Mac Brew 安装PHP
2022-07-30 12:50:00 【-阿布-】
1. 默认镜像源安装太慢或发生包not found,第一步切换镜像源为阿里云
其他更多的源参考:Mac 下 brew 切换为国内源 - 腾讯云开发者社区-腾讯云
注意:使用了国内的源之后注意命令行的外网vpn代理就不要开启了,防止卡住
# 查看 brew.git 当前源
$ cd "$(brew --repo)" && git remote -v
origin https://github.com/Homebrew/brew.git (fetch)
origin https://github.com/Homebrew/brew.git (push)
# 查看 homebrew-core.git 当前源
$ cd "$(brew --repo homebrew/core)" && git remote -v
origin https://github.com/Homebrew/homebrew-core.git (fetch)
origin https://github.com/Homebrew/homebrew-core.git (push)
# 修改 brew.git 为阿里源
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 修改 homebrew-core.git 为阿里源
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# zsh 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc
# bash 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile
# 刷新源
$ brew update
2. 安装php
参考:macOS 使用 Homebrew 安装 PHP7.4 并替代系统自带 PHP 教程 - 知乎
# 搜索php
brew search php
# 安装php7.4
brew install [email protected]
# 在PATH中追加php
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
边栏推荐
猜你喜欢
随机推荐
CV-Model【2】:MobileNet v1
数字化时代,寻求企业财务转型路径的最优解
Apache Log4j2漏洞
奇异值分解(SVD)原理与在降维中的应用(附带例题讲解)(纯理论)
R语言向前或者向后移动时间序列数据(自定义滞后或者超前的期数):使用dplyr包中的lag函数将时间序列数据向后移动一天(设置参数n为负值)
什么是驱动程序签名,驱动程序如何获取数字签名?
【23考研】408代码题参考模板——顺序表
MySQL查询性能优化
[Go]四、模块和包、流程控制、结构体
datax enables hana support and dolphinscheduler enables datax tasks
树形dp小总结(换根,基环树,杂七杂八的dp)
浅析TSINGSEE智能视频分析网关的AI识别技术及应用场景
如何把Excel表格显示到邮件正文里?
双击Idea图标打不开——解决办法
大手笔!两所“双一流”大学,获75亿元重点支持!
I built another wheel: GrpcGateway
物理服务器与虚拟机:主要区别和相似之处
无人艇轨迹跟踪的预设性能抗扰控制研究
湖仓一体电商项目(一):项目背景和架构介绍
解码Redis最易被忽视的CPU和内存占用高问题