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

Fix Brew PHP "dyld: Library not loaded" on Apple Silicon macOS

Immediate terminal fix for dyld missing library errors (libicuuc, libssl, libxml2) after Homebrew upgrades on M1–M4 Macs.


The Problem: Homebrew Broke Your PHP Binary

You ran brew upgrade this morning, and suddenly running php -v, composer install, or php artisan crashes with a fatal dynamic linker error:

dyld[9238]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicuuc.74.dylib
  Referenced from: <7E4B20C3-...> /opt/homebrew/Cellar/php@8.2/8.2.14/bin/php
  Reason: tried: '/opt/homebrew/opt/icu4c/lib/libicuuc.74.dylib' (no such file),
  '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/icu4c/lib/libicuuc.74.dylib' (no such file)
Abort trap: 6

Why Does This Happen on macOS?

Homebrew compiles its PHP formulas with dynamic linking (dylib). When Homebrew updates an underlying dependency like icu4c (from version 74 to 75), openssl@3, or pcre2, it removes the older library version. The pre-existing PHP binary is still looking for the old .74.dylib file, resulting in an immediate crash.

The Immediate Copy-Paste Terminal Fix

To repair your broken Homebrew PHP installation, force Homebrew to reinstall and relink PHP against the newly installed libraries:

# 1. Update Homebrew formulae index
brew update

# 2. Reinstall and recompile dynamic linkages for your PHP versions
brew reinstall php@8.2 php@8.3 php@8.4

# 3. Clean up broken symlinks and relink
brew cleanup
brew link --overwrite --force php@8.3

# 4. Verify the fix
php -v

How Stratos Solves "dyld Hell" Forever

Unlike Homebrew which dynamically links against constantly changing system packages, Stratos uses standalone, statically-compiled PHP runtimes (powered by Static-PHP-CLI). Every single extension—OpenSSL, PCRE2, ICU, cURL, libxml2, mbstring—is baked directly inside the Mach-O executable.

  • Zero Homebrew dependency: Running brew upgrade will never break your local PHP stack.
  • All Apple Silicon optimized: Native ARM64 Mach-O binaries for M1, M2, M3, and M4 Macs.
  • Simultaneous multi-PHP: Run PHP 8.1, 8.2, 8.3, 8.4, and 8.5 side-by-side with zero linker conflicts.

Get Stratos Free — Never Debug dyld Again →