Install Local Server Environment
HTML, CSS and JavaScript files can all be opened in a browser or previewed in Phoenix Code Editor. But for PHP and MySQL – you need some extra software to turn your computer into a virutal environment.
For Mac: Herd + Homebrew MySQL
- Go to herd.laravel.com, download the DMG, and drag Herd into Applications.
- Open Herd from Applications — this triggers onboarding, which installs PHP, nginx, and dnsmasq.
- Check it worked by typing
php --versionandcomposer --versionin Terminal. - Install Homebrew if you don’t already have it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install and start MySQL through Homebrew:
brew install mysql
brew services start mysql
- Check it worked:
mysql --version
- Secure the fresh install (sets a root password, removes test databases):
mysql_secure_installation
Herd serves project folders from its Sites location, or you can run herd link inside any project folder to serve it at projectname.test — worth typing that command out yourself so it’s clear it isn’t automatic.
For Windows: XAMPP
- Go to apachefriends.org/download.html and download the Windows installer.
- Run it. If your antivirus flags it, that’s a known false-positive with the installer — allow it.
- Open the XAMPP Control Panel and click Start next to both Apache and MySQL.
- Test it: open a browser to http://localhost — you should see the XAMPP welcome page.
- Manage databases at http://localhost/phpmyadmin.
Project folders for PHP/MySQL apps must live inside XAMPP’s web root to be served by Apache:
C:\xampp\htdocs\your-project-folder
