Valet requires Homebrew.
The php version that ships with MacOS is usually outdated and does not receive the updates it deserves.
Instructions to install Valet can be found here: https://laravel.com/docs/master/valet#installation
To summarise:
Valet requires macOS and Homebrew. Before installation, you should make sure that no other programs such as Apache or Nginx are binding to your local machine's port 80.
- Install or update Homebrew to the latest version using brew update.
- Install PHP 7.3 using Homebrew via brew install php.
- Install Composer.
- Install Valet with Composer via
composer global require laravel/valet
. Make sure the ~/.composer/vendor/bin directory is in your system's "PATH".
- Run the
valet install
command. This will configure and install Valet and DnsMasq, and register Valet's daemon to launch when your system starts.
Once Valet is installed, try pinging any *.test domain on your terminal using a command such as ping foobar.test. If Valet is installed correctly you should see this domain responding on 127.0.0.1.
Valet will automatically start its daemon each time your machine boots. There is no need to run valet start or valet install ever again once the initial Valet installation is complete.
If after completing the above you still find you are having the 'Unable to determine linked PHP' error then this procedure will fix it:
This will give you output like this:
php
php@5.6
php@7.1
php@7.2
php@7.3
valet-php@5.6
valet-php@7.1
valet-php@7.2
valet-php@7.3
You may only have some of them. For each php version do this:
brew unlink {{FILL PHP VERSION FROM ABOVE}}
This will manually unlink any homebrew php versions you have.
Then link the version you want to use:
brew link {{FILL YOUR CHOOSEN PHP VERSION HERE}}
Then just restart Valet.