Download the PHP package developersharif/php-gui without Composer

On this page you can find all versions of the php package developersharif/php-gui. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-gui

# PHP GUI **Build native desktop apps with PHP — no Electron, no web server, no compromises.** [![Latest Release](https://img.shields.io/github/v/release/developersharif/php-gui?style=flat-square)](https://github.com/developersharif/php-gui/releases) [![PHP](https://img.shields.io/badge/PHP-8.1%2B-blue?style=flat-square&logo=php)](https://php.net) [![License](https://img.shields.io/github/license/developersharif/php-gui?style=flat-square)](LICENSE) [![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey?style=flat-square)](#platform-support)

https://github.com/user-attachments/assets/788e6124-5fe0-49c1-a222-c0bb432f509e


PHP GUI gives you two ways to build desktop applications from the same PHP codebase:

Mode Best for Engine
Native Widgets System-style UIs — forms, dialogs, tools Tcl/Tk via FFI
WebView Modern UIs with HTML/CSS/JS (like Tauri, but PHP) WebKitGTK / WKWebView / WebView2

Both modes work on Linux, macOS, and Windows with zero system dependencies on Linux — libraries are bundled.


Requirements

Minimum
PHP 8.1+
Extension ext-ffi enabled (ffi.enable=true in php.ini)
Composer any recent version

Linux — no extra packages needed (Tcl/Tk is bundled).
macOS — no extra packages needed.
Windows — no extra packages needed.

Enable FFI if not already on:


Installation

That's it. No system Tcl/Tk install, no native build steps.


Quick Start

Create app.php:

A native window opens immediately. No compilation, no manifest files, no packaging step.


Native Widgets

Native widgets render as real OS controls using Tcl/Tk under the hood. The PHP API is simple and consistent across all platforms.

Available Widgets

Widget Description Docs
Window Main application window →
TopLevel Secondary window / dialog launcher →
Label Static or dynamic text display →
Button Clickable button with callback →
Input / Entry Single-line text field →
Checkbutton Checkbox with on/off state →
Combobox Dropdown selection →
Frame Container for grouping widgets →
Menu Menu bar with submenus and commands →
Menubutton Standalone menu button →
Canvas Drawing surface for shapes and images →
Message Multi-line text display →
Image Display images inside windows →

Layout

Every widget supports three layout managers. Mix them freely within a window.

Styling

Pass Tcl/Tk options directly in the constructor array or update them at runtime:

Common options: bg, fg, font, relief (flat raised sunken groove ridge), padx, pady, width, height, cursor.

Dialogs

TopLevel provides native system dialogs — no extra packages:

Menus

Complete Example


WebView Mode

WebView lets you build the UI with HTML, CSS, and JavaScript while keeping all your business logic in PHP. Think of it as Tauri for PHP.

PHP ↔ JavaScript Bridge

JS → PHP — call PHP functions from the browser:

PHP → JS — push events to the frontend:

Serving a Frontend App

Load a built frontend (React, Vue, Svelte, Vanilla — anything) directly from disk. No HTTP server, no open ports, no firewall prompts:

Platform Mechanism URL
Linux phpgui:// custom URI scheme phpgui://app/index.html
Windows WebView2 virtual hostname https://phpgui.localhost/
macOS loadFileURL:allowingReadAccess: file:///path/to/dist/

Vite Dev + Production in One Line

serveVite() auto-detects whether the dev server is running:

Recommended vite.config.js for cross-platform builds:

Bypass CORS — Transparent Fetch Proxy

Cross-origin API calls fail from phpgui:// / file:// origins. One call routes all fetch() requests through PHP:

Full Vite App Example

See the full WebView documentation →


Platform Support

Platform Native Widgets WebView Notes
Linux (x86-64) ✅ ✅ Tcl/Tk bundled. WebView needs libwebkit2gtk-4.1-dev
Linux (ARM64) ✅ — Tcl/Tk bundled
macOS ✅ ✅ No extra dependencies
Windows ✅ ✅ No extra dependencies

Linux WebView dependency:


Documentation

Guide
Getting Started FFI setup, first app, layout, events
Architecture How the FFI bridge and event loop work
WebView Full WebView API reference

Widget reference: Message


License

MIT


All versions of php-gui with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-ffi Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package developersharif/php-gui contains the following files

Loading the files please wait ...