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

amielkedev's avatar

Valet No Longer Working, "Unable to determine linked PHP"

I went to make some edits on a Laravel site of mine today, and my local environment with Valet no longer seems to work. I don't know what changed, but any help would be greatly appreciated.

My biggest issue is that I keep getting "In Brew.php line 187: Unable to determine linked PHP." Any time I do anything in the terminal. I've reinstalled homebrew, php, composer, and a variety of other things a number of time with no success or change.

Every time I go to run "valet install" I keep getting this message, and for some reason it keeps trying to install PHP 7.1 even though I'm running 7.2 locally. Here is exactly what I get in the terminal after running "valet install":

Stopping nginx...
Installing nginx configuration...
Installing nginx directory...
Installing php71...
Error: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Error: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.
[php71] is not installed, installing it now via Brew... ?
Updating PHP configuration...

In Brew.php line 187:

  Unable to determine linked PHP.


install

I'm currently on a Mac running High Sierra, the version of PHP I'm using locally is 7.2.6, and the version of Valet installed is 2.0.6. I've been trying everything I could for the last 3.5 hours with no luck. If any more information is required to help diagnose the problem, let me know. I greatly appreciate any input or help in figuring this out!

0 likes
8 replies
robrogers3's avatar

What's likely happened is the symlink from /usr/local/bin/php(some version) has been lost.

what you can do in run the brew link command.

it will look something like: brow link php70 (or whatever version you are running.)

to find out do this: $ ls -l /usr/local/Cellar/|grep php

1 like
amielkedev's avatar

@Snapey I did try the steps listed at the beginning of it without much luck before, but I will give it another try when I get home for lunch, currently at work. I didn't bother with anything with the second half of that post, as it seems it was more focused on switching between versions of PHP, and I'm just looking to get 7.2 to work without needing to switch between versions. There have been other posts about a similar problem, but I haven't seen anyone that has had Valet trying to install php71 like mine is trying to do. I don't know if that changes the problem or not.

@robrogers3 I've tried to re-establish that link with Homebrew several different ways. I've uninstalled all the PHP versions first, then only installed the newest versions via Homebrew (trying to install it as "php72", "[email protected]", and "php" separately to cover my bases with the new naming convention with Homebrew), and then tried to link up just to find that the link was already established. I've done the same thing with PHP 7.1 just to see if that would work. I've also uninstalled all the PHP to see if the version High Sierra comes with (7.1) would be enough to make Valet happy, though apparently not. Like I mentioned above, Valet keeps trying to install PHP 7.1 (specifically "php71") when I run "valet install", regardless of the version I've currently got installed via Homebrew. After Valet throws the error, I've also tried to link up with that version of PHP--which shows up in the installed list from Homebrew as "[email protected]"--but it says it's a tap only version and to link it I would need to use a "force" flag to do it. I've tried it with the "force" flag, the "overwrite" flag, and a combination of the both with no change.

Thanks again for the suggestions, guys. I'll try what you guys said again over my lunch break to see if something changes or I can get a better idea of what the problem is. Hopefully we can get this figured out, because I've got some updates on a site that need to be made. Still confused about what caused it to stop working, because it worked fine about a week and a half ago when I did the last update on that site.

amielkedev's avatar

@Snapey I went through the steps from that post again with no change.

@robrogers3 I did try relinking to PHP with no change, as well. After checking the link, it looks like it is already established. When I ran "ls -l /usr/local/Cellar/|grep php" I got this as an output:

drwxr-xr-x  3 austinmielke  admin  96 Jun  6 12:05 php

As far as I can tell it looks like it linked up fine.

robrogers3's avatar

so what brew command did you run? can you copy and paste?

amielkedev's avatar

Thanks for your help, but after a bunch of wasted time trying to figure out the issue, I opted just to reformat. Everything is back up and running how it should be. I guess we’ll never know what the issue actually was.

Please or to participate in this conversation.