Introduction
The Laravel team provides Herd andphp.new for beginners, but senior engineers tend to prefer managing each tool individually via a package manager. You can control versions yourself and easily switch between different PHP versions across projects.
This guide walks through installing PHP, Composer, and Node.js (via nvm) with Homebrew, getting you to a state where laravel new works.
Target environment: macOS 13 Ventura or later. Works on both Apple Silicon (M1/M2/M3) and Intel.
Installing Homebrew
Homebrew is a package manager for macOS. If you haven’t installed it, run the following in your terminal.~/.zprofile. If you added it manually, reload the settings.
Installing PHP
1
Install the latest PHP
Homebrew’s
php formula always points at the latest stable version. Laravel 13 requires PHP 8.3 or later.2
Check the version
PHP 8.3.x or later.3
(Optional) Use a specific version
To manage multiple PHP versions, install a versioned formula.Switch versions with Check the currently linked version.
brew link.Installing Composer
1
Install Composer
Install directly with Homebrew.
2
Check the version
3
Configure the path for global installs
So that packages installed with Apply the changes.
composer global require (like the Laravel installer) are usable, add ~/.composer/vendor/bin to your PATH.Append this to ~/.zshrc (or ~/.bashrc):Installing nvm
Install Node.js on a per-user basis using nvm (Node Version Manager). Because it doesn’t requireroot, it plays nicely with AI tools and CLIs that use global npm packages.
1
Install nvm
The latest install script is available on nvm’s GitHub repository.
2
Add to your shell config
The install script automatically appends the following to Reload the settings.
~/.zshrc (or ~/.bashrc). Add it manually if it isn’t already there.3
Verify the installation
Installing Node.js
1
Install the LTS version
2
Set as default
Set the default version so it’s used automatically in new terminal sessions.
3
Check the versions
Verifying the Laravel installation
1
Install the Laravel installer
2
Create a new project
3
Start the dev server
http://localhost:8000 in a browser; if the Laravel welcome page appears, you’re done.When to use Herd
Manual setup with Homebrew is a good fit if you want to match settings with team members and CI environments, or if you frequently switch between multiple PHP versions.