How FrankenPHP Finally Gained Native Windows Support and Boosted Performance

FrankenPHP now runs natively on Windows with full extension support, delivering up to 3.6× speed improvements thanks to a new CGO‑Clang integration in Go 1.26, while the project overcame major compiler incompatibilities through a series of technical experiments and a breakthrough patch.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
How FrankenPHP Finally Gained Native Windows Support and Boosted Performance

Official Announcement

PHP officially announced that FrankenPHP now provides native Windows support, a long‑requested feature that previously required running under WSL.

Performance Boost

Early community benchmarks show dramatic gains: on a Windows Server 2022 machine, swapping the runtime from an optimized Nginx + PHP‑FPM stack to FrankenPHP yielded a 3.6× performance increase (over 260% uplift). Additional benchmarks by a contributor confirm significant speed gains across various workloads.

Speed tip: While native Windows support is fast enough for most development and production scenarios, the absolute highest throughput is still achieved via WSL because Linux I/O and networking stacks remain superior.

The Compiler Challenge

The main obstacle was linking Go’s CGO (which calls PHP’s libphp) with the official Windows PHP build compiled by Visual Studio (MSVC). CGO historically only supported MinGW (GCC) on Windows, making it impossible to link against the MSVC‑compiled PHP libraries.

FrankenPHP is a Go library that uses CGO to call PHP’s libphp.

The official PHP binaries for Windows are built with Visual Studio to ensure performance and stability.

CGO on Windows only supported MinGW, which does not work with the MSVC‑compiled PHP.

Exploring Solutions

Several approaches were tried and each hit a wall:

Option 1 – GCC for PHP: Patching PHP to compile with GCC was rejected by the core maintainers, who prefer the official MSVC binaries.

Option 2 – "Frankenstein" Build (llvm‑mingw): Compiling FrankenPHP with llvm‑mingw and linking to the MSVC PHP binary caused ABI mismatches (different C runtime libraries), leading to crashes.

Breakthrough: Go 1.26 + Clang

The successful path was to enable CGO to use the Clang/LLVM front‑end bundled with Visual Studio. This Clang accepts GCC‑style flags (which CGO expects) while still linking against Microsoft’s STL and runtime libraries, providing a seamless bridge.

During the investigation, the authors discovered that Google had already submitted a perfect patch implementing this capability, which was merged into Go 1.26.

With Go 1.26 and the new lld-link linker, FrankenPHP can now be compiled using the exact same toolchain as the official PHP build, producing a native Windows binary.

All‑Green Test Results

The final artifact is a native Windows binary that directly links the official, stable PHP build. All PHP extensions that work on Windows are available out‑of‑the‑box, and the test suite reports 100% pass rate.

Native Windows binary

Full extension support

Worker mode

Hot reloading

Acknowledgments

The work was made possible thanks to sponsorship from Intelligence X and Les‑Tilleuls.coop.

Original article: https://dunglas.dev/2026/03/windows-support-for-frankenphp-its-finally-alive

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PHPWindowscgoFrankenPHP
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.