gpt4 book ai didi

php - 更改 mac os x 默认 php 版本

转载 作者:行者123 更新时间:2023-12-03 18:08:22 26 4
gpt4 key购买 nike

在我的 mac ( 版本 10.13.6 High Sierra ) php -v输出为 PHP 7.1.32 .
我需要将此 7.1 版本更新到 7.3。

我尝试使用 brew unlink php7.1 删除此版本但它没有用。

我如何升级php版本。

最佳答案

$ brew upgrade php :( 获取最新的自制 php 包)
$ brew install php@7.4 :(安装php 7.4)
$ brew link php@7.4 :(为这个仅限小桶的版本创建一个别名;在安装过程中查看注释输出)
$ echo 'export PATH="/usr/local/opt/php@7.4/bin:$PATH"' >> ~/.bash_profile :(将别名添加到您的路径;请参阅安装过程中的注释输出)
$ source ~/.bash_profile :( 重新加载 .bash_profile 以立即使用新设置)
引用 :How to use the php that brew installed?

关于php - 更改 mac os x 默认 php 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60295426/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com