如何在 Mac OSX 上轻松切换 PHP 版本? [英] How can I easily switch between PHP versions on Mac OSX?

查看:33
本文介绍了如何在 Mac OSX 上轻松切换 PHP 版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 PHP 5.3 到 PHP 7.0 上测试我的应用程序.

I would like to test my application on PHP 5.3 up to PHP 7.0.

在哪里以及如何安装版本以及如何通过运行一个小脚本来切换它们?

Where and how can I install the versions and how can I switch them by running a small script?

推荐答案

如果您安装了两个版本的 PHP,您可以使用 linkunlink 在版本之间切换brew 命令.

If you have both versions of PHP installed, you can switch between versions using the link and unlink brew commands.

例如,在 PHP 7.4 和 PHP 7.3 之间切换

For example, to switch between PHP 7.4 and PHP 7.3

brew unlink php@7.4
brew link php@7.3

PS:为了使这些命令起作用,已安装了两个版本的 PHP.

PS: both versions of PHP have be installed for these commands to work.

这篇关于如何在 Mac OSX 上轻松切换 PHP 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆