简体   繁体   English

在 Mac Catalina 上安装和配置新的 php 版本

[英]Install and configure new php version on Mac Catalina

When i got mac, it had already installed php 7.3.当我得到 mac 时,它已经安装了 php 7.3。 I installed new version of php with Brew to /usr/local/Cellar/php/7.4.9/bin/php and edited ~/bash_profile , where i added我用 Brew 将新版本的 php 安装到/usr/local/Cellar/php/7.4.9/bin/php并编辑~/bash_profile ,我在其中添加

export PATH="/usr/local/Cellar/php/7.4.9/bin:$PATH"
export PATH="/usr/local/Cellar/php/7.4.9/sbin:$PATH"

then did source.bash_profile .然后做了source.bash_profile It worked for the current terminal window, but other terminal windows are still on older PHP version /usr/bin/php , even after restart.它适用于当前终端 window,但其他终端 windows 仍然在较旧的 PHP 版本/usr/bin/php上,即使在重新启动后。 Even plugin in PhpStorm claims that php version is older.甚至 PhpStorm 中的插件也声称 php 版本较旧。 Any help?有什么帮助吗?

You can try the following您可以尝试以下方法

  1. brew unlink php@7.3
  2. brew link php@7.4 --force --overwrite
  3. brew services start php@7.4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM