Valet: Latest homebrew update breaks valet

Created on 28 Feb 2018  路  4Comments  路  Source: laravel/valet

Latest update to homebrew seems to remove the php/php72 formula in favour of just /php

Valet then generates an error "Unable to determine linked PHP" from here https://github.com/laravel/valet/blob/master/cli/Valet/Brew.php#L187

I was able to fix by changing

https://github.com/laravel/valet/blob/master/cli/Valet/Brew.php#L55

to be

return collect(['php','php72', 'php71', 'php70', 'php56']);

however I'm not sure if that's what is needed long term - it has got Valet working again on my machine though.

Most helpful comment

Thanks for the report, fixed on master.

All 4 comments

I encountered the same exact issue. Homebrew changed their php naming conventions: which should have been 'php72' is now simply 'php'. The workaround you suggest is only a first step towards the solution.

To completely solve the issue update /vendor/laravel/valet/cli/Valet/PhpFpm.php with https://gist.github.com/benoitvilliere/f1853030efb437891958921dea4bf4bb

There are some interesting pull requests pending that might solve this so I'm not posting this as a pull request, I consider it a quick fix as there might be better ways to solve the issue. I just needed to get back to work!

I confirm that Valet is broken since the latest homebrew php update

@Alshie's fix seems to be working for me so far. For those who are having trouble finding the file to edit (like I did) it's at: ~/.composer/vendor/laravel/valet/cli/Valet/Brew.php, then edit line 55.

Thanks for the report, fixed on master.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marianvlad picture marianvlad  路  5Comments

eberkund picture eberkund  路  4Comments

AlexVipond picture AlexVipond  路  4Comments

dustinleblanc picture dustinleblanc  路  4Comments

dannygsmith picture dannygsmith  路  5Comments