Setting Up a Local Server Environment
Setting up a local server environment is the first step in installing WordPress on your local machine. You can choose from several options. For the shake of this guide, we will use XAMPP for the windows and Valet for the mac operating system.
Installing XAMPP for Windows
XAMPP is a popular package that includes the Apache web server, MySQL database, PHP, and Perl. It provides a simple way to set up a local development environment on Windows. Here’s how you can install XAMPP:
-
Download XAMPP: Visit the official XAMPP website: https://www.apachefriends.org.
- Click on the “XAMPP for Windows” version to start the download.
- Choose the installer version that corresponds to your operating system (32-bit or 64-bit).
-
Run the Installer:
- Once the download is complete, run the installer by double-clicking the downloaded file.
- If you encounter a Windows Defender warning, click “More info” and then “Run anyway” to proceed.
-
Select Components:
- In the installer window, you’ll see a list of components to install. These typically include Apache, MySQL, PHP, and phpMyAdmin. You can leave the default selections as they are.
-
Choose Installation Folder:
- Choose a destination folder where you want to install XAMPP. The default location is usually
C:\xampp.
- Choose a destination folder where you want to install XAMPP. The default location is usually
-
Start Installation:
- Click the “Next” button to start the installation process.
- The installer will copy the necessary files to your chosen directory.
-
Complete Installation:
- Once the installation is done, you’ll see a checkbox asking if you want to start the XAMPP Control Panel. Keep this option checked and click “Finish.”
Installing Valet for macOS
Valet is a development environment for macOS that makes it easy to run your PHP projects locally. Here’s how you can install Valet on your Mac:
Before you start, ensure you have the following:
-
Homebrew: If you haven’t already, install Homebrew, a package manager for macOS.
-
Composer: Install Composer globally on your system.
-
Valet: Install Valet using Composer:
composer global require laravel/valet -
Install Valet:
Once you have Valet installed via Composer, run the following command to set up Valet:
valet install
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 required services each time your machine boots.