编程语言
首页 > 编程语言> > 终端 – 如何从Mac OS Sierra中删除预安装的Apache和PHP

终端 – 如何从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的输出.

标签:php,terminal,apache,homebrew,sierra
来源: https://codeday.me/bug/20190817/1679676.html