如何卸载 php70 或抑制自制错误消息

Ale*_*gel 4 php homebrew macos

每次我在 Mac 上打开终端时,我都会从自制软件中收到以下消息:

Error: No available formula with the name "homebrew/php/php70" Please tap it and then try again: brew tap homebrew/php

我查看了几种不同的方法来解决这个过时的公式问题,但没有任何效果。有没有办法至少抑制此错误消息,因为我认为我已经安装了正确的 php 版本,从而无需修复此问题

小智 5

我正在使用 ZSH,但遇到了同样的问题。每次我打开一个新终端时,我都有:

Error: No available formula with the name "homebrew/php/php70"
Please tap it and then try again: brew tap homebrew/php
Run Code Online (Sandbox Code Playgroud)

在我的 ~/.zshrc 我有这一行:

export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
Run Code Online (Sandbox Code Playgroud)

我删除了它,因为它不再被使用并且我没有更多的警告消息。


小智 2

不知何故,您可能仍然在您的或同等内容中引用旧路径.bash_profile。当线被移除时,该消息消失。