I am going to show step by step on how to install Valet on your Mac. I tested this on MacOS Mojave.
Before this I encounter these errors:
- Could not symlink, /usr/local/bin is not writable
- In Brew.php line 187: Unable to determine linked PHP
- compact() not defined
It turns out that Laravel does not support PHP 7.3 yet. (At least that’s in my case).
Here’s the step you need to do first. You have to make sure you use the right PHP which is version 7.2.
# Will show you any php packages you've got. make not of that!
brew list | grep php
# Will uninstall any php packages you may have
brew list | grep php | while read x; do brew uninstall --force $x; done
# You may need to run this too
rm -rf /usr/local/Cellar/php
# Clean up Launch Agents
sudo rm /Library/LaunchDaemons/homebrew.mxcl.php*
brew untap homebrew/php
brew doctor # just to make sure you're all clean
ps ax | grep php
# if some PHP daemons are still runing, reboot.
Now, you can install PHP 7.2 by running this command:
brew install email@example.com
after that, you can link the one installed through brew with the supposed location for your PHP.
ln -s /usr/local/Cellarfirstname.lastname@example.org/7.2.13 /usr/local/bin/php
After that, require valet.
composer global require laravel/valet
After that, you can use the instructions found on Laravel website.