crabphp / myphp
Native GPU desktop apps in plain PHP
Requires
- php: >=8.2
Requires (Dev)
- phpgl/ide-stubs: ^1.0
Suggests
- ext-glfw: Needed to run without the myphp binary
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-16 07:33:27 UTC
README
Native desktop apps in plain PHP, drawn on the GPU.
One 12 MB binary holds PHP, the UI toolkit and its assets. No PHP install, no webview, no Electron. Apps build into a single file you can send to anyone.
Install
Linux x86-64 (X11 or XWayland, OpenGL), or macOS on Apple Silicon or Intel (experimental):
curl -fsSL https://raw.githubusercontent.com/crabphp/myphp/main/install.sh | sh
Windows x86-64 (experimental), in PowerShell:
irm https://raw.githubusercontent.com/crabphp/myphp/main/install.ps1 | iex
Create an app
myphp init hello
cd hello
myphp run
app.php:
<?php use PhpUi\App; use function PhpUi\{button, col, text}; $state = (object) ['count' => 0]; $render = fn () => col()->full()->p(24)->gap(12) ->child(text('Count: ' . $state->count)->textSize(26)->bold()) ->child(button('Add', fn () => $state->count++)); (new App('Hello', 480, 320, $render))->run();
The UI is a function of state: change $state, and the next frame shows it.
Ship it
myphp build
You get build/hello, one executable with everything inside.
Editor autocomplete
Optional. If you have Composer:
composer install
This only feeds your editor. Apps never need vendor/.
What's inside
- Layout: flexbox rows and columns, gap, padding, grow, align.
- Components: shadcn/ui style buttons, inputs, select, tabs, table, dialog, dropdown menu, tooltip, toast, switch, slider, charts and more.
- Desktop: file dialogs, notifications, clipboard, file drop, open links, follow system dark mode.
- Fast: one GPU draw for all boxes and shadows; the app sleeps when idle.
Try the built-in demos:
myphp demo dashboard myphp demo desktop myphp demo todo
Docs
Status
Early. Linux is the main platform; macOS and Windows are experimental (built and smoke-tested by CI, not yet tested on real hardware). Not yet: tray icons, menus, multiple windows, global shortcuts.
License
MIT. Fonts: Geist (SIL OFL). Icons: Lucide (ISC).

