Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

garykay's avatar

Php version

I have installed the latest version of php using brew install php71 , it then warns me that this version is already installed , Warning: homebrew/php/php71-7.1.5_17 already installed , but when I check the version I'm told I'm using PHP 5.6.30 (cli) (built: Feb 7 2017 16:18:37) Copyright (c) 1997-2016 The PHP Group. How do I change it to version 7.1?

0 likes
6 replies
tykus's avatar
brew unlink php56 // if you previously installed using Homebrew

brew link php71

An make sure that the Homebrew install path (usually /usr/local/bin) is in your PATH by modifying the PATH variable in your .zshrc or equivalent, for example:

export PATH=$HOME/.composer/vendor/bin:/usr/local/bin:$PATH
garykay's avatar

Thank you. That path is correct, the php71 is linked

"Warning: Already linked: /usr/local/Cellar/php71/7.1.5_17 To relink: brew unlink php71 && brew link php71"

Won't let me unlink php56.

garykay's avatar

Thanks for the help, but still the same issue. I will live with 5.6 for now

tykus's avatar
tykus
Best Answer
Level 104

Probably 5.6 was no installed using Homebrew rather it is the system PHP verison.

If you type which php at the terminal, what do you get? If it is the system version, then perhaps the PATH variable is set incorrectly?

Please or to participate in this conversation.