September 9, 2018
•Last updated November 5, 2023
How to Install and Use Valet with WordPress
Whether you're a beginner or advanced developer who uses WordPress day-to-day, you might face some limitations with your local development environment. This tutorial is targeted towards those looking to improve their environment by utilizing a tool from the Laravel community called Valet. Learn how to install and use Valet with WordPress by watching this video.
Prerequisites
Before diving into installing Valet, I will warn any newcomer that this is for more advanced developers. Maybe you want more control over your local development environment or maybe you just don't want to be tied to other GUI apps like MAMP or XAMPP.
If watching this tutorial confuses you, stick with MAMP or XAMPP. They work just as well but do have some downsides. None of those downsides prohibit you from developing WordPress websites or any other PHP/Apache-based websites locally.
Requirements
Using Valet assumes you're on a Mac capable of running Homebrew. With Homebrew you'll install dependencies needed to build an environment suitable for developing WordPress sites (and other PHP powered sites) locally. Homebrew helps manage versions and keep all of those dependencies in sync.
You'll also need Composer to download the actual Valet package. You can download Composer direct and/or use Homebrew. Consider Composer a dependency manager only for PHP packages/plugins.
Installation
While the video is more thorough, the Valet documentation should get you all set up and ready to rock and roll. I won't cover it step-by-step here since it's very well documented in the documentation.
What about Databases?
Unfortunately, there's no PHPmyAdmin GUI that ships with Vale. You will need to configure an app yourself and/or use the command-line. I'd highly recommend Sequel Pro(FREE) to really visualize your data. Valet has a default host of 127.0.0.1
and a username root
. Your password will be an empty string. You can choose to modify your MySQL setup during installation with Homebrew if you're following along.
This Path Stuff is confusing!
I completely agree. There are some articles worth exploring that explain more concepts behind setting your PATH. All Paths can be the different per package you download. I think that's what makes it a bit confusing:
- What it is and How to Modify the Shell Path in macOS Sierra and OSX using Terminal
- Add to the PATH on Mac OS X 10.8 Mountain Lion and up
- How To Edit Your PATH Environment Variables On Mac OS X
Many of these articles refer to a .bash_profile
file within your root directory. You can freely use this but in my own case I made use of an alternate configuration called .zshrc
. You can find out more about this at https://ohmyz.sh/ which is a handy framework for configuring your shell environment. There are tons of themes, settings, and plugins to use to help your workflow. I highly recommend giving it a try!
Brand new to WordPress and looking to build a custom theme?
Check out my complete series called How to Code HTML To WordPress.
Categories
Products and courses
-
Hello Hotwire
A course on Hotwire + Ruby on Rails.
-
Hello Rails
A course for newcomers to Ruby on Rails.
-
Rails UI
UI templates and components for Rails.