MiPhant is a desktop runtime for PHP applications, allowing you to build and distribute software for Linux and Windows using PHP, HTML, CSS, and JavaScript, running inside native desktop windows powered by Electron.
Unlike a traditional browser, MiPhant executes PHP applications locally using the built-in PHP web server with randomly assigned ports, ensuring application isolation, security, and the ability to run multiple apps simultaneously without conflicts.
- Run PHP applications as native desktop software
- Built-in PHP server with random ports
- Multiple applications running simultaneously without interference
- Statically compiled PHP (no external library dependencies)
- Electron + Chromium-based rendering engine
- Native menus and submenus
- Multi-window support
- Integrated PHP ↔ JavaScript communication
- Dialogs for messages, confirmations, file open/save, and directory selection
- System tray icon support
- PDF export
- DevTools integration
- Application-wide close control
The PHP runtime included with MiPhant is built as a static binary, thanks to the excellent open source project: 👉 static-php-cli
MiPhant provides native support for multi-language applications.
To add translations, create JSON language files inside the app/langs/ directory:
app/langs/en.json
app/langs/pt.json
app/langs/es.json
The system language is detected automatically and exposed to PHP through the environment variable:
MIPHANT_LANG
Even if your application supports only one language, the en.json file is required (it may be empty, but must contain valid JSON {}).
A MiPhant application must follow this minimum structure:
app/
├── config/
│ └── config.json
├── langs/
│ └── en.json
└── index.php
Each application must define its metadata and behavior in app/config/config.json:
{
"app": {
"id": "miphantexample",
"name": "MiPhant Example",
"version": "1.0.0",
"width": 800,
"height": 600,
"resizable": true,
"frame": true,
"icon": "example.png",
"disableAccelerationHardware": true,
"author": {
"name": "",
"email": "",
"url": ""
},
"homepage": "",
"license": "SEE LICENSE IN LICENSE.md",
"copyright": "Copyright (C) 2026 Your Name. All rights reserved."
},
"server": {
"perm": true,
"router": false
},
"dev": {
"menu": true,
"tools": false
}
}MiPhant exposes system and runtime information to PHP through environment variables:
MIPHANT_LANG– System language (en, pt, es, ...)MIPHANT_ARGV– Application argumentsMIPHANT_USERNAME– Current user nameMIPHANT_HOMEDIR– User home directoryMIPHANT_PLATFORM–linuxorwin32
MiPhant supports native menus via JSON definitions.
Create menu files inside:
app/menus/menu.json
Menus can open pages, run JavaScript, open URLs, define shortcuts, separators, and even open new windows with custom dimensions.
MiPhant provides enhanced dialog APIs (recommended instead of window.alert):
- Alert dialogs
- Confirmation dialogs
- File open/save dialogs
- Directory selection
- System notifications (Linux only)
- System tray icon
MiPhant includes native support for SQLite3, allowing local databases without external dependencies.
This makes it ideal for desktop tools, offline systems, and lightweight business applications.
You can distribute your MiPhant-based software by:
- Compressing your project (
ziportar.gz) - Creating a custom installer using NSIS
- Packaging as a DEB package (Linux)
Always include a license with your software. If unsure, consult a legal professional.
- x64 (64-bit)
- Ubuntu 24.04 or newer
- Windows 10 or newer
- Visual C++ Redistributable 14.42
- GitHub Sponsors: https://github.com/sponsors/mugomes/
- More options: https://mugomes.github.io/apoie.html
Copyright (c) 2025-2026 Murilo Gomes Julio
Licensed under the MIT license.
All contributions to the MiPhant are subject to this license.