简体   繁体   中英

MacOS Sierra PHP installation with Homebrew not able to use homebrew php

I recently got my hands on a new macbook and I'm loving the terminal! I'm now configuring my enviroment to run completely on homebrew and on different php versions. To do this, I am following this guide: https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions

Everything works up to the point of

brew unlink php@7.2 && brew link --force --overwrite php@5.6

When I do this I get no error message and everything is OK, however, the guide says that I have to check with php -v to see which version is running and it is NOT php 5.6...

PHP 7.1.16 (cli) (built: Apr  1 2018 13:14:42) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

Is the message I get back.

When I run which php :

/usr/local/bin/php

What I have tried

Restarting apache

removing everything regarding php from /usr/local/php-*

checking brew, both php 5.6 and apache are running

Could anyone help me? Thank you for your time!

EDIT (FIXED): Restarted my Mac and then the brew PHP installation went trough ^^

You just need to open new shell tab / window. You don't have to restart macOS :)

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