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来源文件关闭并重新打开终端.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...