-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Brew.php line 187: Unable to determine linked PHP. #533
Comments
I've had the same problem tonight, and here's what I did to get it running:
It would be nice if Valet had some suggestions on what to do when "Unable to determine linked PHP." comes up. |
@donaldallen wrote:
Two code references: Next it moves on to verify that the linked php binary is a supported one, per this list: |
Getting some error here, tried to follow my symlink and it looks like this Looking at how it matches, it looks for a full path containing one of the supported versions. The supported php version looks for strings named like this |
@Uruloke Should this not be caught by the first item |
uruloke, Yes, I commented locally this checking, and valet was started, but it is not good decision |
@scherii You are right, it should be caught by that, didn't see it. Gotta test this out a little locally and see if I can find an great solution. |
After cloning the repo I can't reproduce the error, lol. |
Try brew update php to another version and change link |
@orangeShadow Just uninstalled php72 then installed php71, linked to php71, upgraded to php72 and linked to php72, then ran valet start and everything seems to work. |
@Uruloke, Can you write your file path and name for php link |
Brew has promoted To get mine working, I edited
to
|
You’d think that. But for some reason it didn’t for me on the path |
That fixes it for me, somehow. |
ln -s /usr/local/Cellar/php71/7.1.16_1/bin /usr/local/bin/php ➜ ~ valet install |
wild guess that most people here having the issue only care if it's 7.1+ and thus are fighting an unnecessary fight. if possible just trash all php things from the system with |
|
Also here is a nice comprehensive guide to upgrading brew and php. Nicely put together: https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions |
this worked for me... brew unlink php brew link --overwrite php valet install |
If you follow donaldallen's comment and it still doesn't fix it you can check if it's symlinked correctly.
Then create a symlink to where this is looking for it: https://github.com/laravel/valet/blob/master/cli/Valet/Brew.php#L181
That was the fix on mine. |
Hi, I found problem !!!!
In line 187 $version is a key of constant's array, but if you set second parameter it would be a $version
|
The code seems to check only if php is a symlink, however I just installed MacOs High Sierra in the latest version and it comes with PHP 7.1.14 which should be fine in many cases, might even be wanted by some systems that don't fully work with PHP 7.2... So I think the logic should take into consideration that the systems built in PHP version might be okay as well! Brew.php:
|
I think this can be closed, as multiple improvements have been made to address the homebrew changes that precipitated this. |
fixed by: $ ln -s /usr/local/opt/php@7.0/bin/php /usr/local/bin/php |
My way to fix this was ti rewrite current php version: |
this works for me too. (I try to follow the docs on laravel.com to run brew install php@7.2, but it failed) |
@hezll If "Unable to determine linked PHP" is on your line 182, you're not running the latest version of Valet. Please update and try again if you have any issues. Thanks! |
This helped me in file: /Users//.composer/vendor/weprovide/valet-plus/cli/Valet/Brew.php on line: 16 change to :
|
Hmm, interesting. brew unlink php@7.1 && brew link php@7.1 --force
The symlinks were initially missing. Afterwards, @tucq88 and @thomasbyoung - try one of the following, depending on what version of PHP you have installed on your system:
Then re-try the |
No luck for me :( |
Now it's on line 205 =)) |
@tucq88 please answer the questions I posted above. |
How is it interesting? It's an obvious bug that these people won't fix for some reason... See: #533 (comment) |
@OZZlE These people? Please direct me to the pull request where you fixed it and I'll be more than happy to review it. |
For anyone who is curious, we're taking a look and trying to figure out a good solution. "Just allow non-Homebrew PHP" may not be a good enough solution; "just allow non-symlinks" may not be a good enough solution; "I have to run a Homebrew command to get my Valet working and therefore it's Valet's fault" is a bad take. If anyone has all of this in their brain and can fully conceptualize the best fix, please, create a new issue and/or pull request and guide us here. Otherwise, please respect the amount of work @drbyte has put into helping people here--with no benefit or payment to himself. |
Perhaps a quick fix (meanwhile) is to document any workarounds as part of the install instructions. I suspect anyone installing this on a fresh machine with latest macOS will run into the problem. This looks to be the place: https://github.com/laravel/docs/blob/5.7/valet.md#installation I may be able to submit something myself, but likely not this week. |
Sorry I was a bit cranky :) What about doing like this: if php is exists and is not a symlink; output this php with version and ask the user if they would like to keep it or update to the latest php, if they go with latest then force symlink it to that. |
I think we have a fix (written by @drbyte, no surprise) on master. Anyone who wants to take a look can; I'm letting it sit there for a few days before I release, but I'll likely release within the next day or two. |
Is this out already? |
So to solve the problem, simply create the directory with then:
|
I found two ways to resolve this on my machines. First is to not use a specific version of php: Second solution is for when you want to use a specific version of PHP: |
Type of @delino12 solve my problem! Thanks dude! |
Returning to this thread I already replied to after spending an hour trying to get it to work :)
and no matter what |
@brianhogg Ya, the A more aggressive advanced step you could explore is to delete your Also, what does |
@delino12 helped me a lot! However, first you need to understand that you still have two php version on your mac. When you use an empty .php file and write down What I found out is that you need to create a new symlink for your mac.
Now it works for me :) I hope it helped you as well |
Rather than manually linking, Homebrew can do the symlinking for you: brew unlink php@7.2
brew link php@7.3 Sometimes adding |
Anybody using macOS 10.15 the file to amend now is ~/.zshrc. Example being.
And now this works fine for me. Best to also open a new terminal to see it working.
|
After updating to PHP 7.4 :
|
I had the same issue, and this was what I did to fix it: Check your current php version Hopefully, this helps🙂 |
Discussion about |
sorry! |
|
@AlvinQinwen please open a new issue if you have questions. Also, please update your copy of Valet and re-test before you do. |
I had the same issue using php 8.3, All the above solutions did not work.
this should do the trick |
Funiconó para mi, gracias! |
I try methods: composer global update, install php 72, brew upgrade, but error repeat and repeat ? what can i do, to run service ? valet version 2.0.8
The text was updated successfully, but these errors were encountered: