删除自制程序的 php 后无法使用 OSX 的 php
Can't use OSX's php after removing homebrew's php
几个月前,我使用自制软件安装了 php55。但是,我不再需要它了,我想使用 OS X 自带的 php 版本。
所以我使用自制程序卸载了 php55。我现在运行php -v
时,出现如下错误:
/usr/local/bin/php: No such file or directory
当我 运行 ls /usr/local/bin | grep php
时,我发现不再有 php 可执行文件(正如预期的那样,因为卸载了软件包)。
当我 运行 echo $PATH
时,它打印:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin
据我了解 PATH 变量的用法,终端应该在 /usr/bin 中搜索名为 php
的可执行文件,但 /usr/local/bin 中没有,但它没有。只要我在系统上安装了其他自制程序包,就不能从 PATH 中删除 /usr/local/bin。
当 运行ning which php
输出符合预期时:/usr/bin/php,OS X 提供的 php 可执行文件.
关于 shell 找不到 php 可执行文件的任何建议?
P.S。 php55包卸载详情:
我卸载了 php55、php55-intl 及其所有其他软件包不需要的依赖项。然后我打开了自制软件-php.
我的brew doctor
输出:
Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:
/usr/local/share/man/de
/usr/local/share/man/de/man1
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
cloog018
gmp4
isl011
libmpc08
mpfr2
zlib
brew prune
对吧...某处一定是指向 /usr/local/bin/php(不再存在)的无效符号链接。
虽然现在问题已经解决了,但是我很好奇为什么homebrew在卸载过程中没有这样做。有什么建议吗?
几个月前,我使用自制软件安装了 php55。但是,我不再需要它了,我想使用 OS X 自带的 php 版本。
所以我使用自制程序卸载了 php55。我现在运行php -v
时,出现如下错误:
/usr/local/bin/php: No such file or directory
当我 运行 ls /usr/local/bin | grep php
时,我发现不再有 php 可执行文件(正如预期的那样,因为卸载了软件包)。
当我 运行 echo $PATH
时,它打印:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin
据我了解 PATH 变量的用法,终端应该在 /usr/bin 中搜索名为 php
的可执行文件,但 /usr/local/bin 中没有,但它没有。只要我在系统上安装了其他自制程序包,就不能从 PATH 中删除 /usr/local/bin。
当 运行ning which php
输出符合预期时:/usr/bin/php,OS X 提供的 php 可执行文件.
关于 shell 找不到 php 可执行文件的任何建议?
P.S。 php55包卸载详情: 我卸载了 php55、php55-intl 及其所有其他软件包不需要的依赖项。然后我打开了自制软件-php.
我的brew doctor
输出:
Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:
/usr/local/share/man/de
/usr/local/share/man/de/man1
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
cloog018
gmp4
isl011
libmpc08
mpfr2
zlib
brew prune
对吧...某处一定是指向 /usr/local/bin/php(不再存在)的无效符号链接。
虽然现在问题已经解决了,但是我很好奇为什么homebrew在卸载过程中没有这样做。有什么建议吗?