DEV Community

Cover image for Setting up PHP for Local Development
Sean Kegel
Sean Kegel

Posted on • Edited on • Originally published at seankegel.com

2 1

Setting up PHP for Local Development

I am building a new PHP application with PHP and Laravel.

Before, for MacOS, I typically installed PHP with Homebrew. Sometimes, I've even used Docker and things like Laravel Sail, however, those could sometimes have performance issues and there were still tools where I wanted PHP locally.

Recently, Laravel Herd was released to make this process much easier. I will use Herd to quickly get started. It is a tool for MacOS to quickly install everything needed to spin up a new Laravel or other PHP based applications locally.

Installing Laravel Herd

If you have used something like Laravel Valet previously, Herd does much of the same, however, it is much faster to setup. Also, since Herd is using static binaries of PHP, it actually provides better performance than the Homebrew installations.

After completing the Herd installation, php, composer, and laravel will be available in your terminal. Any sites you place in the ~/Herd directory will be available in the browser. This path is configurable and additional paths can be added through the settings.

Laravel Herd - Services and PHP Versions

The settings also allow installing additional versions of PHP and quickly switching between them.

Now that we have Herd setup and PHP, Composer, and Laravel installed I will move on to setting up a Laravel application in a future post.

And thank you to the Laravel team and BeyondCode team for creating an amazing tool!


Continue Learning

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more