How to Install PHP 8.6 on macOS Side-by-Side With PHP 8.3–8.5 (Without Breaking Laravel)
Run PHP 8.6 alongside PHP 8.1–8.5 on Apple Silicon and Intel Macs using isolated PHP-FPM Unix sockets — test Laravel and WordPress compatibility safely without breaking existing projects.
Why Upgrading Global PHP to 8.6 Breaks Local Projects
Every November when a new PHP minor release ships, thousands of Mac developers run brew upgrade php — and immediately break three client projects. Older Composer packages, WordPress plugins, and legacy Laravel apps fail on strict deprecations, while Homebrew's dynamic libraries (icu4c, openssl) can trigger dyld: Library not loaded crashes across older PHP binaries.
The clean solution on macOS is never relying on a single global PHP version. Instead, run isolated per-version PHP-FPM Unix sockets so your production client sites stay locked on PHP 8.3 or 8.4 while your test branch or Git worktree runs PHP 8.6 side-by-side.
Option 1: Manual Homebrew Side-by-Side Setup on macOS
If you manage PHP manually via Homebrew on Apple Silicon (/opt/homebrew) or Intel (/usr/local):
# 1. Install PHP 8.6 (current stable formula) without unlinking your daily driver
brew install php
# 2. Keep PHP 8.4 installed for existing Laravel / WordPress apps
brew install php@8.4
# 3. Verify PHP 8.6 directly via its opt path (without switching global PATH)
/opt/homebrew/opt/php/bin/php -v
# 4. Run Composer or Artisan tests specifically under PHP 8.6
/opt/homebrew/opt/php/bin/php $(which composer) update --dry-run
/opt/homebrew/opt/php/bin/php artisan test
To serve one Nginx vhost on PHP 8.6 while another stays on PHP 8.4, configure separate listen = /tmp/php86-fpm.sock and listen = /tmp/php84-fpm.sock pools in each version's php-fpm.d/www.conf and point each site's fastcgi_pass directive to its dedicated socket.
Option 2: Isolated Per-Site PHP Pools & Git Worktrees in Stratos
Stratos automates isolated PHP-FPM Unix sockets (~/Library/Application Support/Stratos/fpm/*.sock) natively in Swift on macOS (Apple Silicon M1–M4 & Intel) with zero Docker VM overhead:
- Per-Site PHP Version Isolation: Pin Site A to PHP 8.3, Site B to PHP 8.4, and a test site to PHP 8.5/8.6 simultaneously — switching takes one click with zero global
brew unlinkchoreography. - Test Upgrades in a Git Worktree Subdomain: Spin up a dedicated branch worktree (e.g.,
php86-upgrade.myapp.test) with its own isolated SQLite database and PHP pool while keepingmyapp.testuntouched on your stable PHP version. - Zero-Config Debugging & Local AI MCP: Catch upgrade emails in built-in MailCatcher (port 1025), inspect stack traces in DumpServer (port 9912), and let Cursor or Claude Code read local logs and database schemas over loopback MCP (
127.0.0.1:9921/mcp).
Quick PHP 8.6 Compatibility Checklist for Laravel & WordPress
- Run
composer check-platform-reqsunder PHP 8.6 before updatingcomposer.lock. - Run your Pest / PHPUnit suite with
error_reporting(E_ALL)to catch new deprecation notices early. - Keep your default local runtime on PHP 8.3 or 8.4 until all production extensions and WordPress plugins publish official PHP 8.6 support.
Download Stratos Free for macOS → Compare vs Laravel Herd & Docker →
Replace $296+/yr of macOS Dev Subscriptions with Stratos
Start free forever with native Nginx, PHP 8.1–8.5, .test HTTPS, Xdebug 3, and read-only MCP schema tools—or lock in the Founder Lifetime license (3 Macs) for $71.20 (reg. $89) with code BFCM20.