Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

php-tkui

> 编程语言
Open source

Build native desktop applications with PHP only

508 stars0 likes1 views
WebsiteGitHub

About

Build native desktop applications with PHP only

php-tkui

php-tkui allows you to build desktop ui applications with PHP only. It leverages FFI extension and Tcl/Tk for that, thus you don't need to compile or install any external extensions.

Requirements

  • PHP >= 8.2
  • ffi extension must be enabled
  • Tcl/Tk >= 8.6

Getting started

Make sure that Tcl/Tk is installed in your OS. For Debian/Ubuntu based distros you may install it with apt:

bash
sudo apt install tcl tk

Next, check FFI extension is enabled:

bash
php --ri ffi

Clone this repository and try out the demos:

bash
git clone https://github.com/skoro/php-tkui.git php-tkui
cd php-tkui
composer install
php demos/buttons.php

Configuration

You may enable some application features like:

  • debug mode
  • appearance

Copy the provided .env.example into .env and customize the options.

Debug mode allows you to find out which commands are executed by Tcl engine. To enable the debug mode set:

env
DEBUG=true
DEBUG_LOG=php://stdout

All the debug messages will go to the console. You may specify a file name instead of console.

To change the application appearance comment out THEME option and set one of: clam, alt, default, classic. Additional themes for Windows: winnative, xpnative, vista. By default, auto is used, setting a theme depending on OS:

env
THEME=auto

Windows

You need to install one of Tcl/Tk binary distributions and set path to dlls in .env file like this:

WINDOWS_LIB_TCL=c:\\tcltk\\bin\\tcl86t.dll
WINDOWS_LIB_TK=c:\\tcltk\\bin\\tk86t.dll

Also, you can build your own Tcl/Tk distribution, take a look at BUILD-WIN.md doc how to do that.

macOS

You need to install one of Tcl/Tk binary distributions same as for Windows. The easiest way is to install it using brew:

bash
brew install tcl-tk

Then you need to set paths to dylibs in .env file:

DARWIN_LIB_TCL=/usr/local/Cellar/tcl-tk/[installed_version]/lib/libtcl8.6.dylib
DARWIN_LIB_TK=/usr/local/Cellar/tcl-tk/[installed_version]/lib/libtk8.6.dylib

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPdesktopffiguiphp

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言