简体   繁体   中英

How update php5 to php7 (OSX Sierra)

I'm following this tutorial ( https://jason.pureconcepts.net/2016/09/upgrade-php-mac-os-x/ ) to update php5 to php7 and I have this folder usr/local/php5-7.0.12-20161101-102255 but when I asks in Terminal > php -version I get 5.6.25 . I don't know how to use the php 7 installed

regards.

On MacOS, you may try Homebrew to install packages. For instance, PHP 5.6, PHP 7.0, PHP 7.1 or any other ones can be installed with similar command

$brew install php70

Also, remember to use /usr/local/bin within your $PATH to ensure proper version of PHP will be used. Such as set following in your ~/.bashrc (in case you use Bash shell

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

Well I think I have already found and understood the solution. Once installed with homebrew php7 and therefore the /usr/local/Cellar/php70 folder has been created. What you have to do is to have the path /usr/local/ bin in the $ PATH. There is a php file that is a symbolic link to the php folder of the version to use, ie if that symbolic link points to /usr/loca/Cellar/php70 php --version will give you version 7. But it does not You need to add the / usr / local / Cellar / php70 path to $ PATH. Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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