在macos中如果使用brew 官方默认的core tap 只可以安装官方最新的稳定版PHP, 如果想要安装 php 5.6 或者 php 8.4版本的PHP就需要使用第三方的tap , 这里分享一个比较全面的brew tap  shivammathur/php 这个tap里面包含了从php5.6到最新版php8.4的所有可用最新版本PHP, 而且是同步官方自动更新

安装tap源:

brew tap shivammathur/php

查看可用PHP版本

brew search php

安装指定版本PHP

# php 8.4安装

brew install shivammathur/php/php@8.4

# php 5.6安装

brew install shivammathur/php/php@5.6

目前支持的PHP版本 从 php 5.6 php 7.x php 8.x 到最新的php 8.4版本应有尽有!!

PHP Support

PHP VersionNTS FormulaDebug FormulaZTS FormulaDebug ZTS FormulaPHP 5.6php@5.6php@5.6-debugphp@5.6-ztsphp@5.6-debug-ztsPHP 7.0php@7.0php@7.0-debugphp@7.0-ztsphp@7.0-debug-ztsPHP 7.1php@7.1php@7.1-debugphp@7.1-ztsphp@7.1-debug-ztsPHP 7.2php@7.2php@7.2-debugphp@7.2-ztsphp@7.2-debug-ztsPHP 7.3php@7.3php@7.3-debugphp@7.3-ztsphp@7.3-debug-ztsPHP 7.4php@7.4php@7.4-debugphp@7.4-ztsphp@7.4-debug-ztsPHP 8.0php@8.0php@8.0-debugphp@8.0-ztsphp@8.0-debug-ztsPHP 8.1php@8.1php@8.1-debugphp@8.1-ztsphp@8.1-debug-ztsPHP 8.2php@8.2php@8.2-debugphp@8.2-ztsphp@8.2-debug-ztsPHP 8.3php or php@8.3php-debug or php@8.3-debugphp-zts or php@8.3-ztsphp-debug-zts or php@8.3-debug-ztsPHP 8.4.0-devphp@8.4php@8.4-debugphp@8.4-ztsphp@8.4-debug-zts

参考文章

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: