19

I had a problem which appeared all of the sudden saying: Unable to determine linked PHP. which I could not solve so I uninstalled valet, php and dependencies. Then I installed fresh php7.1 but when I run valet install I get quiet slightly similar error: Homebrew PHP appears not to be linked.

Epsilon47
  • 768
  • 1
  • 13
  • 28

6 Answers6

37

First, find the PHP version installed via.

brew list

In my case it was php@7.3, then

brew link php@7.3 --force --overwrite

and finally

valet install

:)

zarpio
  • 10,380
  • 8
  • 58
  • 71
11

Homebrew can't find the correct PHP version, have you linked them up properly?

brew link php71

Wouter Van Damme
  • 761
  • 9
  • 15
5

brew link php@7.2 --force --overwrite

That will push this--

If you need to have this software first in your PATH instead consider running: echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile

I ran both independently then tried valet install (worked like a charm).

PT-83
  • 309
  • 5
  • 18
2
brew install php@7.1

then link it

brew link php@7.1 --force --overwrite
SirPhemmiey
  • 585
  • 6
  • 7
0
$ brew unlink php && brew link --force php@7.1
Syscall
  • 19,327
  • 10
  • 37
  • 52
Ian
  • 74
  • 7
  • 4
    Please, add an explanation. See [how to answer](https://stackoverflow.com/help/how-to-answer). – Syscall Apr 13 '21 at 08:43
0

If you are coming here following a migration from Intel to M1 and having Valet not use the php cask from the /opt/ folder, this did the trick for me:

echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc.

Tommaso Boggia
  • 140
  • 2
  • 12