23

I installed Valet for the first time and I had some problems listed below:

  1. It throws an error saying:

Unable to determine linked PHP.

Even though I have PHP 7.1 installed by php-osx.liip.ch so it just goes ahead and installs PHP 7.0 with homebrew anyway!

  1. In the non-laravel projects my localhost does not work and it responds:

ERR_EMPTY_RESPONSE

and then Valet itself does not work either!

  1. I'm getting an error on Valet domains with message:

This site can’t be reached laravel_from_scratch.dev’s server DNS address could not be found.

So I decided to uninstall it by running $ valet uninstall, it returns the corresponding response but then when I'm running $ valet it is all there! How to uninstall it correctly?

BTW, I posted this issue also on the Valet GitHub page.

Stacked
  • 6,892
  • 7
  • 57
  • 73
Sina
  • 1,092
  • 1
  • 9
  • 19

2 Answers2

77

I guess I find the solution after a little bit playing around.

It seems Valet uninstall command does not work as expected. To uninstall it first run the composer command to uninstall the php dependencies:

$ composer global remove laravel/valet

then to uninstall the dependencies installed with the Homebrew, first run;

$ brew list

just so you know we are in the same page then if you see dnsmasq and php70 in case you do not want them or you have php7 installed in another approach (like me) run:

$ brew uninstall dnsmasq

and

$ brew uninstall php70

Then go to your user directory and delete the .valet hidden directory or run the terminal command like so:

$ sudo rm -r ~/.valet
Sina
  • 1,092
  • 1
  • 9
  • 19
  • 1
    Thank you! Your instructions were exactly what I needed. – jeff-h Feb 08 '17 at 22:07
  • If you get a "directory is not empty error", try: `sudo rm -r ~/.valet` instead to recursively empty and delete the directory. – voidstate Oct 31 '17 at 10:13
  • 1
    In case anyone runs into this, when I uninstalled valet like this, I found the xcode-select, namely the xcode command line tool got uninstalled too, need to re-install it after reboot your mac. – Homer Mar 02 '18 at 06:02
  • To use Laravel Valet again, remember to reinstall `dnsmasq` and also reinstall or update `xcode-select`. You should update xcode-select via command line using `softwareupdate --install ` replacing `software` with the xcode-select version found after the asterisk using `softwareupdate --list`. – aullah Jul 09 '18 at 20:03
  • 6
    Worth mentioning that the directory changed from `~/.valet` to `~/.config/valet` – William Lepinski Nov 09 '18 at 11:28
30

An official response here: https://github.com/laravel/valet/issues/341#issuecomment-287048987

valet uninstall --force
sudo brew services stop nginx
sudo brew services stop php70
sudo brew services stop dnsmasq
brew uninstall nginx
brew uninstall php70
brew uninstall dnsmasq
rm -rf ~/.valet
rm /usr/local/bin/valet
Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
Torkil Johnsen
  • 2,375
  • 1
  • 18
  • 18
  • One-liner: `valet uninstall && composer global remove laravel/valet && sudo brew services stop nginx php70 dnsmasq && brew uninstall nginx php70 dnsmasq && rm -rf ~/.valet` – aubreypwd Jan 13 '20 at 19:20
  • In my case, I wanted to keep PHP: `valet uninstall && composer global remove laravel/valet && sudo brew services stop nginx dnsmasq && brew uninstall nginx dnsmasq && rm -rf ~/.valet` – aubreypwd Jan 13 '20 at 19:23