TypePHP\Qt
Guide
Widgets
Advanced
Reference
FAQ
  • English
  • 简体中文
GitHub
Guide
Widgets
Advanced
Reference
FAQ
  • English
  • 简体中文
GitHub
  • Reference

    • Reference
    • CLI
    • API Reference
    • Packaging
    • Platform Support

Platform Support

Capability matrix

PlatformBuild / run / headless verifyPackagingDependencies
Windows✅✅ a dist/ directory (windeployqt)Qt 6 + MSVC
macOS (Apple Silicon)✅✅ dist/<Name>.app (macdeployqt + ad-hoc signature)brew install qtbase libiconv
Linux (Debian/Ubuntu)✅✅ dist/<name>/ (ldd closure + patchelf + qt.conf)see below

All three platforms pass --selftest 14/14 and --difftest 20/20.

Tested environments

PlatformEnvironment
WindowsWindows 10.0.26100 · MSVC 2022 BuildTools · Qt 6.9.3 msvc2022_64 · tpc v0.9.4
macOSApple Silicon · Homebrew qtbase 6.11.2 · tpc-built private embed runtime
LinuxDebian 12 arm64 · qt6-base-dev 6.4.2 · cmake 3.25.1 · Qt 6.4.2

On Linux, build produces an ELF PIE aarch64 binary (about 58 MB); under QT_QPA_PLATFORM=offscreen --selftest is 14/14, --difftest 20/20 and --shot renders, all rc=0. package produces dist/hello/ (measured: 85 .so files + 10 Qt plugins, 140.3 MB), and the artifact is equally green under env -i QT_QPA_PLATFORM=offscreen.

Linux dependencies

The first build compiles a private PHP embed runtime, so besides Qt you need:

apt install -y qt6-base-dev cmake g++ pkg-config bison re2c autoconf xz-utils patchelf \
  zlib1g-dev libxml2-dev libsqlite3-dev libonig-dev libgmp-dev libmpfr-dev
PackagePurpose
qt6-base-devQt 6 Widgets
cmake g++ pkg-configbuild
bison re2c autoconf xz-utilsthe PHP source build flow
patchelfrewrites DT_RPATH when packaging
zlib1g-dev libxml2-dev libsqlite3-dev libonig-devPHP extensions
libgmp-dev libmpfr-devphpx dependencies

On Linux qtphp doctor checks these 12 items and prints a paste-ready apt install -y … for whatever is missing (WARN only).

Platform differences at a glance

ConcernWindowsmacOSLinux
Artifact name<name>.exe<name><name>
Build entry ymlproject.ymlproject.macos.ymlproject.linux.yml
C++ compilerMSVC (cl.exe)clang++g++
Qt linkingQt6Xxx.libframeworks (-F + -I)-lQt6Xxx
Qt locationcommon C:/D: pathsbrew keg-onlyDebian multiarch /usr
PHP runtimeDLLs must be copiedfully static, nothing to copyas macOS
Packaging toolwindeployqtmacdeployqtassemble by hand (ldd closure)
Dependency checkDLLs presentotool -Lldd
GUI subsystem--no-consolen/an/a
Headless platform pluginqwindows.dllmust copy in libqoffscreen.dylibthe whole platforms/ dir is already in the bundle

Known boundaries

The following are not yet verified (per the project's own records):

  • xcb on a real X desktop — the Linux side has only been verified under offscreen.
  • The eglfs / linuxfb / vnc platform plugins — untested.
  • Cross-distro — only tested on Debian 12; Ubuntu / Fedora untested.
  • Copying the offscreen plugin on Windows — the logic mirrors macOS, but no machine was available to verify it.
  • Pure tray apps — the package treats the tray as an add-on to a window app; a background-resident tray app needs a hand-written bridge.

Platform-specific build flags

FlagPlatformWhy
/Zc:__cplusplusWindowsrequired by the Qt MSVC headers
/permissive-Windowsas above
/EHscWindowsexception handling
-fPICLinuxposition-independent code
-F<QT>/libmacOSmust appear in both cxx-flags and ld-flags

There is a macOS gotcha with -F: framework forwarding headers such as QtWidgets/qabstractitemview.h use qualified names internally, so -F is needed at compile time as well as link time.

Edit this page on GitHub
Last updated: 10/6/26, 3:13 AM
Prev
Packaging