I remember the absolute headache of managing local PHP environments a decade ago. You had a single global install, and testing a legacy application meant totally breaking your modern projects. We all reached for tools like PHP Brew to compile different versions from source, or VirtPHP, hoping for a Python-like virtual environment experience.
Today, those older tools are either completely abandoned or painfully slow to use. Compiling PHP from scratch just to test a script is no longer necessary. The PHP ecosystem has completely modernized, bringing lightning-fast native binaries, modern application servers, and seamless container orchestration that make local development an absolute breeze. Let’s look at the best ways to isolate your PHP projects and manage versions right now.
Why Move Beyond PHP Brew and VirtPHP?
If you are still trying to maintain an old VirtPHP setup or waiting twenty minutes for PHP Brew to finish a local build, it’s time to upgrade. Here is why the modern workflow is infinitely better:
- Instant switching: Modern tools swap your system’s path variables or container routes in milliseconds, rather than compiling binaries from scratch.
- True isolation: VirtPHP tried to isolate dependencies locally, but modern container tools guarantee absolute parity between your local machine and your production server.
- Zero system pollution: Newer native tools package everything into self-contained binaries that never conflict with your operating system’s core packages.
- Team consistency: You can commit a single configuration file to your repository, and your whole team gets the exact same PHP version and database setup instantly.
Top Modern PHP Local Environments
The ecosystem has divided into three main approaches: native speed, modern application servers, and containerized perfection. Here are the standout options available today.
1. Laravel Herd
If you want the absolute fastest, most frictionless experience on macOS or Windows, Laravel Herd is my top recommendation. Despite the name, it works brilliantly for any PHP application, not just Laravel.
Herd ships as a native application and does not use Docker. It uses pre-compiled binaries, meaning you can swap between PHP 7.4 and PHP 8.3 globally or per-directory in a fraction of a second. It handles DNS routing automatically, meaning you just drop a folder into your directory and it serves it via a local testing domain.
|
1 2 3 4 5 6 7 |
# Switch your entire system to 8.3 instantly herd use 8.3 # Force only the current folder to run on 8.1 herd isolate 8.1 |
2. FrankenPHP
If you are looking for a modern, unified application server that totally rethinks how PHP runs, FrankenPHP is an absolute game changer. Written in Go and built on top of the incredibly fast Caddy web server, it bundles everything you need into a single binary.
You don’t need to configure Nginx or PHP-FPM anymore. FrankenPHP handles everything, including automatic HTTPS for your local environment. It even features a worker mode that keeps your application booted in memory, resulting in massive speed boosts. It’s fantastic for local development and scales perfectly right into production.
|
1 2 3 4 |
# Start a web server and run the current directory instantly frankenphp php-server |
3. DDEV and Lando
If you need complete environmental isolation—meaning isolated databases, caching layers, and web servers for every single project—you need a container orchestrator. DDEV and Lando are brilliant wrappers around Docker that hide all the complex configuration.
DDEV in particular has seen massive adoption across Europe, becoming the de facto standard for DACH-region powerhouses like TYPO3 and Shopware. You don’t need to know how to write a Dockerfile; you just tell DDEV what kind of project you have, and it builds the environment.
|
1 2 3 4 5 |
# Configure a new PHP project with MariaDB instantly ddev config --project-type=php --php-version=8.3 ddev start |
4. Homebrew & Shivam Mathur’s Tap
For macOS developers who just want a raw command-line utility without any GUI or web server magic, Homebrew combined with Shivam Mathur’s PHP tap is the industry standard.
This essentially replaces PHP Brew entirely. Instead of compiling, you download pre-built bottles of any PHP version you need. It requires a bit more manual linking to switch versions, but it’s rock solid for basic CLI scripting.
5. phpenv
If you are coming from the Ruby or Node world and love the dotfile approach, phpenv is exactly what you are looking for. It monitors your terminal path, and whenever you enter a directory containing a .php-version file, it automatically swaps your CLI executable.
The Showdown: Which Should You Pick?
Tool | Best For | Technology | OS Support |
|---|---|---|---|
Laravel Herd | Lightning-fast, native web serving without Docker overhead. | Native Binaries | macOS, Windows |
FrankenPHP | Single-binary performance with built-in server and worker mode. | Go Server (Caddy) | macOS, Windows, Linux |
DDEV | Complex CMS setups (TYPO3, Drupal) needing dedicated databases. | Docker Containers | macOS, Windows, Linux |
Homebrew | CLI-only developers who just want system-level binaries. | Package Manager | macOS, Linux |
phpenv | Developers who want automatic folder-based version switching. | CLI Wrapper | macOS, Linux |
Decision Guide
- Just want to write PHP and hate configuring servers? → Download **Laravel Herd** and enjoy the native GUI experience.
- Want automatic HTTPS and insane performance from a single binary? → Fire up **FrankenPHP**.
- Working with European agencies on massive CMS projects? → Adopt **DDEV** to ensure your local database and cache match production perfectly.
- Writing simple terminal scripts on a Mac? → Stick to **Homebrew** and manually link the versions you need.
- Managing dozens of legacy microservices via terminal? → Drop a
.php-versionfile in each repo and use **phpenv**.
Glossary
- Virtual Environment
- A localized folder that contains project-specific dependencies and executables, preventing global system package conflicts. VirtPHP attempted to do this natively for PHP.
- Containerization
- The modern standard for isolation, where an application runs inside a lightweight, standalone Linux package that contains its own operating system tools, libraries, and settings.
- Worker Mode
- A runtime strategy where your PHP application stays booted in memory between requests instead of restarting from scratch, offering massive performance gains.
- Native Binary
- An executable file that has already been compiled for your specific operating system architecture, allowing it to run instantly without local compilation.
FAQ
What exactly happened to VirtPHP?
VirtPHP was an ambitious project to bring Python-style virtual environments to PHP, but it was largely abandoned over a decade ago. The rise of Docker and Composer made its approach to dependency isolation unnecessary.
Why is PHP Brew considered outdated?
PHP Brew compiles PHP versions entirely from source on your local machine. This process is incredibly slow and often breaks on newer operating systems due to missing system-level dependencies.
Does Laravel Herd only work for Laravel projects?
Not at all. While optimized for Laravel, Herd easily runs vanilla PHP scripts, Symfony, WordPress, and essentially any standard PHP application with blazing fast speed.
What makes FrankenPHP different from traditional PHP-FPM?
Unlike traditional PHP-FPM setups that spin up a new process for every single request, FrankenPHP is an app server written in Go that can run your PHP app in memory via worker mode, making it insanely fast.
Is Docker too heavy for basic local PHP development?
It can be. If you are on a laptop and only need a basic web server, tools like Herd or FrankenPHP are much lighter on battery life. However, if you need specific database versions, Docker is still the safest choice.
Can I run different PHP versions per directory without using Docker?
Yes. Laravel Herd allows you to isolate specific folders to specific PHP versions natively. Alternatively, command-line tools like phpenv achieve the exact same thing.
What is the standard way to install PHP on macOS today?
Most macOS developers use Homebrew alongside Shivam Mathur’s custom PHP tap. It provides pre-compiled binaries for nearly every modern and legacy PHP version available.
Can I use DDEV for non-PHP projects?
Yes. While DDEV is heavily optimized for PHP content management systems, it easily supports Python, Node.js, and static HTML site setups.
Do I need to uninstall PHP Brew before using Herd?
It is highly recommended. Having multiple environment managers trying to hijack your terminal’s PATH variable simultaneously will lead to constant routing conflicts.
Is Laravel Valet still relevant in 2026?
Valet is still a robust open-source tool, but it has largely been superseded by Herd. Herd includes its own pre-compiled PHP binaries, whereas Valet relies on your system’s Homebrew installation.
