![]() ![]() ![]() Now that you have Homebrew, installing PHP takes only one command: brew install installs a specific version of PHP, which we need for our WordPress installation. Initialize Homebrew with an update once it’s installed using the brew update command from above. If you need to install it fresh, run this instead: /bin/bash -c "$(curl -fsSL )" If you already have the Homebrew package manager installed, run an update to be sure you have the latest version: brew update If you don’t get an empty output for that command, you may need to stop or uninstall some applications. This will show which applications, if any, are currently using that port. To do that, open Terminal app and run the following command: lsof -i :80 We need to ensure that no other programs, such as Nginx or Apache, are using port 80. If you already have those and you’re confident your port 80 is clear, you can go ahead and skip to installing Valet. You might also want to set up your database at this point. Let’s get Valet up and running! Before we install Valet and use it, we need to make sure the port is available, install or update Homebrew, and install Composer and PHP. You’ll need to install Nginx, PHP, MySQL, and all their dependencies in macOS via Homebrew.Valet doesn’t support development in languages other than PHP.Unlike Homestead, which is an official prepackaged Laravel Vagrant box with everything included, you’ll need to install PHP and a database.There’s no official support for other operating systems besides macOS, although there is a thriving Linux fork as well.It allows you to create custom drivers to extend Valet’s support to other types of PHP applications.It offers native support for 21 different frameworks and content management systems, including WordPress.This is incredibly helpful when testing on different devices or demoing for clients. Valet allows you to share your local sites publicly using tunnels through Ngrok or Expose.All *.test domains will be proxied automatically to sites on your local machine using Dnsmasq.Valet runs Nginx behind the scenes, starting when your machine starts.There’s no need to create a fresh configuration for each new site.Running a virtual machine isn’t required, giving you one less thing to worry about.It’s a set-it-and-forget-it solution for those looking to develop with PHP on macOS while using minimal resources. These days my development environment of choice is Laravel Valet because it is lightweight, quick to set up, and runs effortlessly in the background. Thankfully, over the years, new technologies have come around to make this process easier and faster. It was easy to get overwhelmed before you even saw any code. There were so many options and always a million ways to mess up the installation. Setting up a local development environment used to be a major hurdle. In this tutorial, I’ll cover what Valet does (and what it doesn’t), then I’ll show you how to install Valet and use it to serve up a local WordPress site. Laravel Valet’s minimalist approach makes it a great choice for local WordPress development. ![]()
0 Comments
Leave a Reply. |