Saturday, May 21st, 2022

Installing Valet on macOS with Homebrew

I a note about notes

Over the years, I’ve written a lot of posts about similar things (if not the same thing). As is the case with software, however, the way we go about doing things can change.

The purpose of posts like this in this category is to start keeping a running list of notes for the things I usually do and how I do them when this post is updated.

I don’t know whether I will update these posts or draft a new post. If there is no “Last Updated” date at the top of it, it hasn’t been updated.


TL:DR:I’ve used several different development environments on my local machine over the years and keep coming back to Valet. Here are the notes I use to install Valet on macOS.

Valet on macOS

The longer version of this guide should still be updated, even if it is a few years old. The notes below explain how to set it up in 2021.

Laravel Valet

install homebrew

First, go to the Homebrew homepage and follow the instructions. Or just run the following command in terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

already installed?

If Homebrew is already installed, run $ brew update, If there are any commands it asks you to run (eg prune), go ahead and do them here.

Verify that PHP is installed (or install it)

if you run $ php -v You should see terminal output stating which version of PHP you have installed. otherwise run $ brew install php,

This will install PHP after which you can run the same command again. If you Still See the output it’s not installed, make sure your shell has the correct path to the binary.

Enter the following command:

  1. $ export PATH=$PATH:~/.composer/vendor/bin
  2. $ source ~/.zshrc

you may need to use ~/.bash_profile Instead of ~/.zshrc If you are using bash.

set up valet

first run $ composer global require laravel/valet, then run $ valet install,

Verify that you have installed MySQL

To verify that MySQL is installed, you can run $ which mysql Because it is the database server that is commonly used with WordPress.

If it’s not installed, you can install it via Homebrew or use a package like DBngin from the same developers who built TablePlus.

Download and Unarchive WordPress

Download WordPress and unarchive the application in your directory.

install wordpress

In your terminal, navigate to the location where you have installed WordPress and run $ valet link $$ valet secure, This will create a TLD domain for you so that you can access WordPress and do so through https://,

End

navigate to your site https://[your-valet-link].test And then start the WordPress installation.

Source link