php - mac 使用 Homebrew 软件升级 native php,无法正常工作

标签 php macos terminal command-line-interface homebrew

我试图将我的 mba 的原生 php 从 5.3.X 更新到 5.4.X 我这样做了: brew tap Homebrew 软件/欺骗 brew tap josegonzalez/homebrew-php brew 更新 brew 安装 php54

这会在/usr/local/cellar/php54 上安装 php 5.4 现在在执行 which php 时,它给了我/usr/bin/php

我试图将其添加到 ~/.bashrc : 导出 PATH=/usr/local/cellar/php54:$PATH

现在当我重新打开终端并输入 which php 它仍然告诉我 php 位于/usr/bin/php

有什么好的方法可以解决这个问题吗?

最佳答案

来自 https://github.com/josegonzalez/homebrew-php

If you would like to swap the PHP you use on the command line, you should update the $PATH variable in either your .bashrc or .bash_profile:

# Swapping from PHP53 to PHP54
# export PATH="$(brew --prefix josegonzalez/php/php53)/bin:$PATH"
export PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH"

Please be aware that you must make this type of change EACH time you swap between PHP minor versions. You will typically only need to update the Apache/FPM when upgrading your php patch version.

关于php - mac 使用 Homebrew 软件升级 native php,无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18806532/

相关文章:

php - 无法上传 joomla 模板

php - 识别 PHP 未使用的变量

java - Facebook 应用程序 - 如何在用户的墙上帖子上发布动态内容

php - jQuery Ajax 表单提交,调用 php 登录脚本

macos - 10.11中mac App如何在用户摇动鼠标(光标变大)时收到通知

ruby-on-rails - "rails s"使用 Ruby 1.8.7 而不是 Ruby 1.9.3 (OS X 10.7.2)

linux - MAC .bash_profile : change directory string colors and file names by type

macos - OS-X 中的 MonoDevelop,尝试创建一个包含多个项目的解决方案

应用程序的Java控制台和GUI模式?

ubuntu - 在 ubuntu 上,当我从终端运行 sublime text 时,它将打开两个实例