It’s happening! I am thrilled to announce the immediate availability of official Windows support for FrankenPHP.
Since the project’s initial release, this has been by far the most requested feature. While many of you have been successfully running FrankenPHP on Windows via WSL (Windows Subsystem for Linux), native support was the “white whale” we’ve been chasing for a long time.
Today, that chase is over. You can now run FrankenPHP natively on Windows, with 100% compatibility, including our killer features like Worker Mode and Hot Reloading.
Performance That Screams
We didn’t just want it to work; we wanted it to be fast. Early benchmarks from the community are already painting an incredible picture.
One user compared FrankenPHP against an already optimized Nginx/PHP-FPM environment on the same Windows Server 2022 machine. The results speak for themselves: a staggering 3.6x performance boost (an increase of over 260%) simply by switching the server runtime.
Additionally, new extensive benchmarks by @henderkes further validate these impressive gains natively on Windows across various workloads.
A quick tip for maximum speed: While native Windows support is incredibly fast and convenient for development and many production workloads, it is worth noting that for the absolute highest raw throughput, running FrankenPHP via WSL (Windows Subsystem for Linux) still yields more performant results due to Linux’s underlying I/O and networking architecture. In production, prefer using Linux if you can!
The Challenge: A Tale of Two Compilers
Why did it take so long to get here?
Some brave souls tried to port FrankenPHP to Windows early on (huge thanks to them!), but beyond the usual cross-platform headaches (file paths, filesystems), we hit a fundamental, structural wall.
Here is the technical issue in a nutshell:
- FrankenPHP is a Go library that calls PHP’s
libphpusing CGO. - Official PHP builds on Windows are compiled with Visual Studio (MSVC) to ensure the best performance and stability.
- Go’s CGO, however, had no support for Visual Studio on Windows. It historically only supported MinGW (GCC).
This left us with a massive compatibility gap. We couldn’t simply link the two together.
The Path to a Solution
We explored several options, each with its own dead end:
Option 1: Add GCC support to PHP for Windows. We considered patching PHP to support compiling with GCC. However, the PHP maintainers (understandably) weren’t keen on the extra complexity. We wanted to guarantee absolute stability, avoid ecosystem fragmentation, and use the official binaries directly, so relying on an alternative compiler than Visual Studio (MSVC), the only compiler officially supported by the PHP project, was a no-go.
Option 2: The “Frankenstein” Build (llvm-mingw). We tried an intermediate solution: compiling FrankenPHP with llvm-mingw and linking it against the official Visual Studio-compiled PHP. This failed because of the Standard Library mismatch. When you mix binaries compiled with MinGW (which uses msvcrt.dll or its own runtime) and MSVC (which uses ucrt / vcruntime), you run into critical issues. If one side allocates memory (malloc) and the other tries to free it, or if you try to pass file descriptors across the boundary, the application crashes. They effectively speak different dialects of “C”.
The Breakthrough: Go 1.26 and clang
We eventually realized the best path forward was to add support to CGO for the Clang/LLVM frontend provided by Visual Studio.
For those unfamiliar, Visual Studio includes a version of Clang that works as a drop-in replacement for the MSVC compiler (cl.exe). It accepts GCC-like flags (which CGO likes) but uses the Microsoft STL and runtime libraries under the hood. It’s the best of both worlds.
While exploring prior art and preparing to write a patch for Go, we stumbled upon an incredible, undocumented contribution from Google that did exactly this.
This patch made it into Go 1.26.
With this new capability in Go, and by using the lld-link linker, we were finally able to compile FrankenPHP using the same toolchain as PHP itself.
100% Green Tests
The result is a native Windows binary that links directly against the official, stable PHP binaries provided by the PHP project.
Crucially, because we link against the official PHP builds, all native PHP extensions supported on Windows work out of the box in FrankenPHP.
We updated the FrankenPHP codebase to handle the remaining Windows quirks, and I’m happy to report that all tests are green.
- ✅ Native Windows Binary
- ✅ Full Extension Support
- ✅ Worker Mode
- ✅ Hot Reloading
Credits & Sponsorship
This complex work was made possible thanks to the generous sponsorship of Intelligence X and Les-Tilleuls.coop.
Open Source sustainability is hard work. If your company relies on FrankenPHP, Caddy, or API Platform, please consider sponsoring me on GitHub. Your contributions allow me to dedicate time to solving deep technical challenges like this one and keeping the ecosystem healthy and fast.
Try It Now
This support has been merged in Pull Request #2119. You can download the latest binaries for Windows from our releases page!
A huge thank you to everyone who helped investigate this, specifically @TenHian for the initial exploration and @henderkes for the massive work on the final implementation.
Happy coding on Windows! 🚀
