I was running on PHP 7.1, but then I wanted to switch to PHP 7.0. But when prompting for my password I changed my mind so I pressed Ctrl+C. Now when I'm trying to switch PHP versions, the following happens:
禄 valet use 7.0 -vvv giel@Mac0025
In Brew.php line 255:
[DomainException]
Unable to determine linked PHP.
Exception trace:
Valet\Brew->linkedPhp() at /Users/giel/.composer/vendor/weprovide/valet-plus/cli/Valet/PhpFpm.php:133
Valet\PhpFpm->switchTo() at /Users/giel/.composer/vendor/weprovide/valet-plus/cli/includes/facades.php:28
Facade::__callStatic() at /Users/giel/.composer/vendor/weprovide/valet-plus/cli/valet.php:462
Silly\Application->{closure}() at n/a:n/a
call_user_func_array() at /Users/giel/.composer/vendor/php-di/invoker/src/Invoker.php:82
Invoker\Invoker->call() at /Users/giel/.composer/vendor/mnapoli/silly/src/Application.php:85
Silly\Application->Silly\{closure}() at n/a:n/a
call_user_func() at /Users/giel/.composer/vendor/symfony/console/Command/Command.php:250
Symfony\Component\Console\Command\Command->run() at /Users/giel/.composer/vendor/symfony/console/Application.php:936
Symfony\Component\Console\Application->doRunCommand() at /Users/giel/.composer/vendor/symfony/console/Application.php:240
Symfony\Component\Console\Application->doRun() at /Users/giel/.composer/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /Users/giel/.composer/vendor/weprovide/valet-plus/cli/valet.php:718
use [<phpVersion>]
I tried valet restart and valet fix but the problem persists...
Hm, I also seem to trigger this error when I make a type like valet use 7. for example. An exception gets thrown but the original link is not restored.
Is it safe to say that this is an issue where _"when a valet use-command fails it breaks valet+"_?
@kanduvisla This can happen for a number of reasons. But the main one is that there was some error within the PHP installation you're switching to. Which will cause the linking of the php version you're switching to, to fail.
For most MacOS systems, when the linking fails you will revert to your native PHP version. Valet+ cannot determine the php version of a native system. You will need to manually relink to homebrew [email protected]. E.G: brew link [email protected] --force --overwrite.
Most helpful comment
@kanduvisla This can happen for a number of reasons. But the main one is that there was some error within the PHP installation you're switching to. Which will cause the linking of the php version you're switching to, to fail.
For most MacOS systems, when the linking fails you will revert to your native PHP version. Valet+ cannot determine the php version of a native system. You will need to manually relink to homebrew [email protected]. E.G:
brew link [email protected] --force --overwrite.