Mac M2芯片配置PHP环境

Mac M2芯片配置PHP环境

1. XAMPP

官网地址 https://www.apachefriends.org/



安装

安装完成

web server打开后,在打开localhost 成功!

2. PHPBrew(PHP版本管理)

官方文档 https://github.com/phpbrew/phpbrew/blob/master/README.cn.md

HomeBrew关于 PHPBrew的文档 https://formulae.brew.sh/formula/phpbrew

安装
这里我们通过homebrew安装

powershell 复制代码
brew install phpbrew


init

powershell 复制代码
Using root: /Users/fanzhen/.phpbrew
Initialization successfully finished!
<=====================================================>
Phpbrew environment is initialized, required directories are created under

    /Users/fanzhen/.phpbrew

Paste the following line(s) to the end of your ~/.bashrc and start a
new shell, phpbrew should be up and fully functional from there:

    source /Users/fanzhen/.phpbrew/bashrc

To enable PHP version info in your shell prompt, please set PHPBREW_SET_PROMPT=1
in your `~/.bashrc` before you source `~/.phpbrew/bashrc`

    export PHPBREW_SET_PROMPT=1

To enable .phpbrewrc file searching, please export the following variable:

    export PHPBREW_RC_ENABLE=1


For further instructions, simply run `phpbrew` to see the help message.

Enjoy phpbrew at $HOME!!

<=====================================================>
powershell 复制代码
# phpbrew
source /Users/fanzhen/.phpbrew/bashrc
export PHPBREW_SET_PROMPT=1
export PHPBREW_RC_ENABLE=1

之后就可以正常使用了

安装php7.4.33版本

powershell 复制代码
phpbrew install 7.4.33 +default


但是这里下载的速度太慢了需要解决!!!

参考

  1. PHPBrew 使用指南 https://www.jianshu.com/p/d5b0d40e56ee
  2. phpbrew set mirror(加速)https://minbaby.github.io/post/2018-11/phpbrew-set-mirror/
相关推荐
凯丨11 分钟前
PHP2Shell(CVE-2026-109618 / CVE-2026-109619)——配置层缓解方案
php
小白旗1 小时前
PHP 严重漏洞风险提醒:如何排查运行环境并做好安全更新
开发语言·php
wdfk_prog2 小时前
lwip教程 31:SLIP vs PPPoS——串口 IP Framing、错误检测、协商与工程边界
网络协议·tcp/ip·php
vipxieliang2 小时前
ThinkPHP MVC 模式入门:从控制器到视图的完整实践
后端·php·thinkphp
Kimi-学长2 小时前
PHP 爆出两个高危安全漏洞!CVE-2026-109618、CVE-2026-109619 修复方案与防护指南
开发语言·php
众乐乐_20082 小时前
【实操解决】PHP5.4~PHP7.3的 CVE-2026-109618与CVE-2026-109619问题
安全·php
贵州诚鑫致达科技有限公司3 小时前
接入汇聚都是环怎么防环路?华为SEP加RRPP混合环
服务器·华为·php
BingoGo4 小时前
别再只用数组了,这 10 种 PHP 数据结构值得了解
后端·php
weixin_417396834 小时前
酒店弱电怎么验收?四个阶段与逐项检查清单
开发语言·前端·php·综合布线·弱电
JaguarJack4 小时前
别再只用数组了,这 10 种 PHP 数据结构值得了解
后端·php·服务端