终端 – 如何从Mac OS Sierra中删除预安装的Apache和PHP

我一直试图弄清楚如何从我的macbook pro中完全删除预装的Apache和PHP ……原因是我使用的是Apache和PHP的自制版本.我正在使用的PHP的当前版本是PHP 7,您可以在下面的屏幕截图中看到

Localhost PHP Version

但是当我在终端中使用php -v时它会显示PHP版本5.6 ..请参阅下面的截图.

enter image description here

我试图找到预装的PHP,但似乎无法找到它…你们能帮助我并指出正确的方向吗?谢谢.

解决方法:

删除系统macOS二进制文件不是一个好主意,它们将在下一次系统升级期间重新安装,某些系统脚本可能需要它们.

要从命令行启用自制软件php,请阅读brew info php70的输出:

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/.profile or your shell’s equivalent configuration file:
export PATH=”$(brew –prefix homebrew/php/php70)/bin:$PATH”

如果您已安装php 7.2,请检查brew info php72的输出.

相关文章

最近做自动化测试时,深感自己对前端涉猎太少,加上对这块比...
homebrew本身就是一个git仓库。使用homebrew安装软件包时,会...
一、Homebrew安装、卸载等命令Homebrew的安装和卸载都非常简...
在mac系统中,使用homebrew可以很方便的管理包。按照官网的说...
我按照说明从这里使用brew安装mysqlhttps://gist.github.com...
我在macOS10.12.4上安装了nginx1.10.3和php5.5.38作为开发服...