当前位置:网站首页>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"
边栏推荐
- Win11打不开exe应用程序怎么办?Win11无法打开exe程序解决方法
- 【Kaggle:UW-Madison GI Tract Image Segmentation】肠胃分割比赛:赛后复盘+数据再理解
- R语言筛选时间序列数据的子集(subset time series data)、使用window函数筛选连续日期时间范围内的数据(start参数和end参数分别指定起始和结束时间)
- [PostgreSQL] - Storage structure and cache shared_buffers
- shell的理解
- datax enables hana support and dolphinscheduler enables datax tasks
- Beijing, Shanghai and Guangzhou offline events丨The most unmissable technology gatherings at the end of the year are all gathered
- MySQL【排序与分页】
- Hand tearing read-write lock performance test
- 多表联查的学习
猜你喜欢
C#实现软键盘的制作
OpenHarmony环境搭建报错: ImportError: cannot import name ‘VERSION‘ from ‘hb.__main__‘
MySQL查询性能优化
Apache Log4j2漏洞
常见的云计算安全问题以及如何解决
最基础01/完全背包
What are the hard-core upgrades and applications that cannot be missed in Greenplum 6.0?
树形dp小总结(换根,基环树,杂七杂八的dp)
How to display an Excel table in the body of an email?
PyQt5快速开发与实战 8.6 设置样式
随机推荐
Heshu Group: Make smart cities smarter and make real life better
WinForm枚举容器中的控件,实现控件统一事件处理机制
CMake库搜索函数居然不搜索LD_LIBRARY_PATH
R语言使用方差分析ANOVA比较回归模型的差异、anova函数比较两个模型并报告它们是否存在显著差异(两个模型的数据相同,一个模型使用的预测特征包含另外一个模型的特征)
MySQL中的select,from, join, on where groupby等执行顺序
无人艇轨迹跟踪的预设性能抗扰控制研究
int a=8,a=a++,a? int b=8,b=b+1,b?
[BJDCTF2020]Cookie is so stable-1|SSTI injection
在 Scala 中读取整个文件
解码Redis最易被忽视的CPU和内存占用高问题
There is no one of the strongest kings in the surveillance world!
关于香港高防IP需要关注的几个问题
no matching host key type found. Their offer: ssh-rsa
Win11打不开exe应用程序怎么办?Win11无法打开exe程序解决方法
js 构造函数 return 非空对象,其实例化的对象在原型上的差异
我又造了个轮子:GrpcGateway
666666
Decoding Redis' most overlooked high CPU and memory usage issues
私有化部署的即时通讯平台,为企业移动业务安全保驾护航
缓存