NKS Hub APT repo

Signed package repository for Debian and Ubuntu with PHP 5.6 to 8.5, also for Debian 10 and Ubuntu 18.04 and 20.04, which the official sources no longer build for. Every branch has the PHP2Shell fix.

Installing PHP 7.4 from repo.nks-hub.cz on a clean Ubuntu 18.04 and the PHP2Shell fix in the changelog

The NKS Hub APT repo is a signed package repository for Debian and Ubuntu. It installs PHP 5.6 to 8.5, including on Debian 10 and Ubuntu 18.04 and 20.04. The usual way to run several PHP versions on one server is packages.sury.org, the repository maintained by Ondřej Surý. sury.org drops older system releases over time, though, and publishes nothing new for these three. The servers running them stay in service, and a fix for a serious PHP vulnerability cannot wait until they move to a newer system. So we build the same packages for them as well, and we install PHP from the repo on the servers we look after.

What the repo contains

  • A mirror of sury.org for Debian 11, 12 and 13 (bullseye, bookworm, trixie) and Ubuntu 22.04 and 24.04 (jammy, noble). It is refreshed every night and covers amd64, arm64 and armhf. sury.org published its last packages for Debian 11 on 10 November 2026. We build the newer revisions for it ourselves, amd64 only; arm64 and armhf stay at that last release.
  • Our own builds for Debian 10 (buster) and Ubuntu 18.04 and 20.04 (bionic, focal), amd64 only. They come from the same source packages at the same revision; only the end of the version number differs (for example +focal~1). Ubuntu 18.04 also gets its own build of curl, because the system library is too old for PHP 8.4 and 8.5.
  • PHP 5.4.45 as the nks-php5.4-legacy package for Debian 11 (component legacy). It installs into /opt/php/5.4.45 so it stays out of the way of the system PHP. The PHP project has not fixed this version since 2015 and sury.org does not carry it, so we port security fixes to it by hand from the PHP 5.6 patches.
  • LiberShare in the libershare component for Ubuntu 24.04 (amd64 and arm64). It is a program for sharing files directly between users (peer to peer). The libershare package is a wizard that picks what to install for the machine: the libershare-backend core with the libershare-frontend web interface, the desktop app, or, for single-board computers, a kiosk mode, an XFCE or GNOME desktop, remote administration over VNC and RustDesk and video acceleration for the RK3588 chip. For the Radxa Rock 5B there is also a switch between booting from the SD card and from a USB drive.
  • Textida in a separate repository at https://repo.nks-hub.cz/textida/ (suite stable, component main, amd64 and arm64). New releases of the Textida editor are copied here from GitHub automatically twice an hour, so an ordinary apt upgrade brings the new version.

The mirror has every extension published on sury.org. Besides those bundled with PHP (mysql, intl, gd and others) that includes PECL extensions such as imagick, redis, xdebug, apcu, memcached and mongodb, each built for every branch. Our own builds for Debian 10 and Ubuntu 18.04 and 20.04 have about 100 of the 123 PECL source packages as of 15 November 2026. The extensions named above are there, except xdebug for PHP 8.5. Missing ones include grpc, xlswriter and uploadprogress. The mirror also carries the PHP 8.6 test release, RC5 as of 15 November 2026. It is a pre-release and does not belong on a production server.

Installing PHP 7.4 from repo.nks-hub.cz on a clean Ubuntu 18.04 and the CVE-2026-109618 and CVE-2026-109619 entry in the package changelog
A clean Ubuntu 18.04: adding the key and the source, installing PHP 7.4 and the PHP2Shell fix in the package changelog.

Every branch has the PHP2Shell fix

On 21 October 2026 the PHP project released fixes for two critical vulnerabilities known together as PHP2Shell (CVE-2026-109618 and CVE-2026-109619). Both let an attacker run code on the server without logging in. New releases came out only for the supported branches 8.2 to 8.5. For 7.4, 8.0 and 8.1 the PHP team offered a source patch only, and older branches got nothing. sury.org had the fix in every branch from 5.6 up on the same day.

Fixed Debian packages were therefore available straight away. On Ubuntu, however, PHP is usually installed from the PPA on Launchpad, where the builds were delayed and the server answered with error 503. The mirror takes the Ubuntu packages directly from sury.org, where they were ready together with the Debian ones. For Debian 10 and Ubuntu 18.04 and 20.04 we built the fixed branches the same evening.

State as of 7 November 2026: every branch from 5.6 to 8.5 in all eight distributions carries the fix. We checked this two ways. The changelog of the php-common package of every version on offer has the entry for both CVEs. And in clean Debian 10, Ubuntu 18.04 and Ubuntu 20.04 containers we installed every branch with the most common extensions and ran it. PHP 5.4 in the nks-php5.4-legacy package has the fix ported from the 5.6 branch. In its test run nine tests failed that pass in the unpatched build. Eight cover file upload progress tracking, which the fix switches off on purpose in every branch. The ninth only checks the wording of the out-of-memory message.

How the repo is kept up to date

The repo is managed by aptly in Docker, and nginx serves the files. Five steps run every night:

  1. The current state of sury.org is fetched.
  2. For Debian 10 and 11 and Ubuntu 18.04 and 20.04, every PHP branch that has a newer source package in the mirror is rebuilt. Each distribution builds in its own container, and the build includes PHP's test suite.
  3. The new packages are published and signed.
  4. PECL extensions that are missing or behind are rebuilt the same way.
  5. A check script compares every branch in every distribution with the current source revision and fails if anything is missing or behind.

On 15 November 2026, rebuilding five PHP branches for all three older distributions took three hours, and the PECL extensions another two and a half.

Adding the repo

curl -fsSL https://repo.nks-hub.cz/public-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/nks-dev.gpg

sudo tee /etc/apt/sources.list.d/nks-php.sources <<EOF
Types: deb
URIs: https://repo.nks-hub.cz/
Suites: $(. /etc/os-release; echo $VERSION_CODENAME)
Components: php
Signed-By: /usr/share/keyrings/nks-dev.gpg
EOF

sudo apt update
sudo apt install php8.4-fpm php8.4-mysql php8.4-curl php8.4-mbstring

Ubuntu 18.04 does not read .sources files. One line in /etc/apt/sources.list.d/nks-php.list does the job instead, as in the screenshot above.

Things to watch out for

  • Debian 10 is archived. Its sources must point to archive.debian.org, including buster-updates and debian-security. The buster packages are built against those updates. Without them apt refuses the installation with a "held broken packages" message.
  • Debian 11 has its security updates in the archive. deb.debian.org still serves their index, but downloading the packages ends with error 404. The bullseye-security line must therefore point to http://archive.debian.org/debian-security.
  • The ondrej/php PPA can stay enabled. When the repo has a newer PHP version or revision, apt takes it from the repo. For the same version and revision it prefers the PPA package, which carries the same fixes.
  • Our own builds are amd64 only. On arm64 and armhf, PHP is available only for the mirrored distributions, for Debian 11 in the last release from 10 November 2026.
  • Key. The repo is signed with the Ed25519 key NKS Dev <dev@nks-hub.cz>, fingerprint 13A5 50D1 DF00 421C F78E B5C1 6146 AF03 3594 6F69, valid until 15 April 2028.

The repo is public and free to use at repo.nks-hub.cz. The scripts that build it are not public. If you are missing a branch or an extension, write to dev@nks-hub.cz.

← Back to overview