Product Hunt🚀 We are live on Product Hunt! Support our launch & use code PHLAUNCH20 for 20% off Pro→
Stratosv1.7.0
Guides & Comparisons• 3 min read

How to Run Multiple PHP Versions Simultaneously on macOS

Run concurrent PHP 8.1, 8.2, 8.3, 8.4, and 8.5 FPM pools side-by-side on macOS without port conflicts, crashes, or 502 Bad Gateway errors.


The Challenge of Multi-Version PHP on macOS

Modern web development teams often maintain legacy client applications on PHP 8.1 or 8.2 while building new projects on PHP 8.3, 8.4, or testing early features on PHP 8.5. Historically, running multiple PHP versions locally required switching global Homebrew links (brew unlink php@8.2 && brew link php@8.3) or orchestrating complex Docker compose files.

Simultaneous PHP-FPM Pool Architecture in Stratos

Starting in version 1.7, Stratos provides native multi-version PHP pool orchestration. Rather than maintaining a single active PHP version, Stratos runs isolated PHP-FPM pools concurrently on dedicated Unix domain sockets:

  • ~/Library/Application Support/Stratos/fpm/php8.1.sock
  • ~/Library/Application Support/Stratos/fpm/php8.2.sock
  • ~/Library/Application Support/Stratos/fpm/php8.3.sock
  • ~/Library/Application Support/Stratos/fpm/php8.4.sock
  • ~/Library/Application Support/Stratos/fpm/php8.5.sock

Zero Port Conflicts & Resilient Startup

Because each pool communicates exclusively over a Unix domain socket, there are zero TCP port collisions. When you start or restart PHP-FPM, Stratos inspects your active projects and provisions every required PHP version pool automatically. If you have five sites each running a different PHP version, all five pools start together. Restarting one pool does not terminate the others, completely preventing 502 Bad Gateway errors.

Pinning PHP Versions Per Project

  1. Open the Stratos main window and navigate to Sites.
  2. Select your target site from the sidebar.
  3. In the PHP Version dropdown, pick any installed version (8.1 through 8.5).
  4. Stratos updates the site's Nginx upstream socket configuration and reloads Nginx dynamically in under 200 milliseconds.