微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

macos – 为什么我的OS X仍然运行较旧的PHP,即使我更新了它?

我刚通过命令行在终端更新了我的系统PHP.

删除了.bash_profile中的导出路径,因为它指向mamp,但由于某种原因,当我在终端中运行PHP -v时,我的PHP仍然说5.3不是5.4.

有谁知道为什么会这样.我也关闭了终端并重新打开以查看更改.

解决方法:

好像你没有为$PATH添加新路径.

引用您发布的website的常见问题解答:

Why does PHP -v on the command line still show my old version?

PHP-osx doesn’t overwrite the PHP binaries installed by Apple, but installs everyting in /usr/local/PHP5. The new PHP binary is therefore in /usr/local/PHP5/bin/PHP.

You can also adjust your PATH do include that directory, eg. write into your ~/.profile file the following

export PATH=/usr/local/PHP5/bin:$PATH

因此,在nano或vim等编辑器中打开.profile或.bash_profile,并将最后一行导出PATH = /usr/local/PHP5 / bin:$PATH添加到适当的文件中.

使用source~ / .bash_profile或source~ / .profile来源文件关闭并重新打开终端.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐