简体   繁体   English

自制更新为PHP-已安装较新版本,但仍显示PHP 5.4

[英]Homebrew update to PHP - Installed newer version but still showing PHP 5.4

I am tying to update the PHP on my Mac OS X machine from 5.4 to 5.6. 我打算将Mac OS X计算机上的PHP从5.4更新到5.6。 I am using Homebrew. 我正在使用Homebrew。 I installed PHP 5.6 using Homebrew successfully: brew install php56 我使用Homebrew成功安装了PHP 5.6:brew install php56

However, when I rebooted the unix shell, and typed the command php -v, it still shows PHP 5.4.10. 但是,当我重新启动unix shell并键入命令php -v时,它仍然显示PHP 5.4.10。

I ran: export PATH="$(brew --prefix homebrew/php/php56)/bind:$PATH". 我跑了:export PATH =“ $(brew --prefix homebrew / php / php56)/ bind:$ PATH”。

However, the php -v has not changed to 5.6. 但是,php -v尚未更改为5.6。 What can I do to get my system to use 5.6? 如何使系统使用5.6? Thanks! 谢谢!

Mac OSX has an own php installed. Mac OSX已安装了自己的php。 The same for Python and Ruby. 对于Python和Ruby也是一样。 With Homebrew, you installed a new/extra version of php (not an update of the pre-installed version) which runs perfect separately. 使用Homebrew,您安装了新的/额外版本的php(而不是预安装版本的更新),该版本可以单独完美运行。

The php command points to the native Mac OSX php. php命令指向本地Mac OSX php。 If you run Homebrew, the webserver will use his own php version. 如果您运行Homebrew,则网络服务器将使用他自己的php版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM