PHP as a native desktop app — FrankenPHP + Wails, no HTTP server.
FrankenWails embeds the PHP runtime directly inside a native desktop window using FrankenPHP and Wails. There is no HTTP server — the WebView's requests are intercepted by Wails and routed to FrankenPHP in-process.
Note: This is a companion repo for my FrankenPHP conference talks. It's meant as inspiration and a reference implementation, not a production framework. Feel free to explore, fork, and adapt the patterns for your own projects. Links to talks and slides will be added here.
- Building Desktop Apps with PHP (slides) — ConFoo 2025
- Building Native Desktop Apps with PHP — php[tek] 2026
WebView navigates to /index.php
→ Wails AssetServer intercepts (no TCP, no network)
→ Go http.Handler routes to FrankenPHP
→ PHP executes the script
→ HTML response rendered in WebView
The WebView thinks it's making HTTP requests, but they're just function calls to Go. No port, no socket, no network stack involved.
make php # Build PHP 8.3 (ZTS, embed) via static-php-cli (one-time)
make env # Generate env.yaml with CGO flags from the PHP build
make run # Build the binary + launch the desktop appThe PHP build is cached in dist/.php/ — subsequent runs skip the build if libphp.a exists. To rebuild PHP from scratch:
make php-clean # Remove cached downloads and build artifacts
make php # Rebuild
make env # Regenerate env.yamlInstall the EnvFile plugin, then in your Run Configuration enable EnvFile and add env.yaml to load the CGO flags automatically.
| Demo | Description |
|---|---|
| Calculator | HTMX form posting to PHP — inline addition without page reload |
| HTMX Regions | Four regions loading concurrently with staggered PHP sleep() delays |
| Todo | SQLite-backed task list with add, complete, and delete |
| File Browser | Browse the local filesystem, navigate directories, preview text files |
frankenwails/
├── main.go # Wails app + FrankenPHP initialization
├── build/php/ # PHP build system (static-php-cli)
├── examples/ # PHP pages (document root)
│ ├── index.php # Landing page with demo cards
│ ├── calculator/ # HTMX calculator demo
│ ├── htmx/ # Concurrent regions demo
│ ├── todo/ # SQLite todo app
│ └── files/ # Local file browser
├── Makefile
├── go.mod
├── LICENSE.md
└── CLAUDE.md
- Go 1.26+
- FrankenPHP (built automatically via
make php) - Wails v2
- macOS, Linux, or Windows
Code is MIT — see LICENSE.md. The talk material is licensed under CC BY 4.0 — free to share and adapt with attribution.
