# Noble Patcher for PHP Prepare local Debian packages with the official fixes for CVE-2026-109618 and CVE-2026-109619 while retaining the installed PHP branch and upstream version. The tool adds a local Debian revision, such as `+parallax1`, and preserves the original distribution packaging. Compilation targets **Ubuntu 24.04 Noble amd64**. Packages are installed manually after validation. ## Source and applicability Start with an authenticated, unpacked Debian PHP source package in `3.0 (quilt)` format. Its original distribution patches must already be applied. Downloading an exact source version with `apt-get source` normally prepares that state. The supported source packages are also mirrored on Spaces. The downloader checks the original uploader signature and every referenced file before extraction: ~~~sh curl -fL 'https://distro.parallax.link/sources/php/fetch-php-source-0.1.0.py' -o fetch-php-source.py printf '%s %s\n' '09627b9ae5e42e9378e8f82ec5d1b3723dde69078a0b762f54ab201d1e3385d1' 'fetch-php-source.py' | sha256sum --check - python3 fetch-php-source.py --branch 8.4 --output ../php8.4-source --extract ~~~ This requires Python 3, curl, gpgv and dpkg-source. Use ../php8.4-source/source as the unpacked source path below. Branches 8.2, 8.3 and 8.5 are also available. The PHP source and public signing key are fetched from distro.parallax.link; build dependencies come from Ubuntu archives. The [source catalog](https://distro.parallax.link/sources/php/noble/manifest.json) lists the exact signed source descriptors, archives and checksums. The [online guide](https://distro.parallax.link/noble-patcher.html#source) has the complete commands. The bundled manifest identifies these base releases and the corresponding fixed upstream releases: | Base source version | Fixed upstream release | | --- | --- | | 8.2.34 | 8.2.35 | | 8.3.35 | 8.3.36 | | 8.4.26 | 8.4.27 | | 8.5.11 | 8.5.12 | This table identifies candidate source versions. Actual applicability depends on the complete branch patch set and distribution changes. **Proceed only when inspection reports `ready`.** Already fixed, already patched and unsupported sources are reported separately. The main security patches remain byte-for-byte identical to the official upstream payloads. PHP 8.4 and 8.5 include ordered prerequisite commits needed to apply the fixes to these base releases. Raw originals and applied payload hashes are bundled. Complete NEWS-only diffs are excluded only where the manifest explicitly records that transformation. PHP 8.5 prerequisite merges use official first-parent `.diff` payloads with a commit mbox header added; source hunk bodies and contexts are unchanged. An incompatible distribution source stops without a partial patch. Patch payloads and provenance are recorded in [patches/manifest.json](patches/manifest.json). The original security fixes belong to the upstream PHP contributors. Read the [official advisory](https://www.php.net/archive/2026.php#2026-10-21-5) for the affected behavior. ## Verify, inspect, prepare, build Verify all vendored payloads, raw upstream references, declared prerequisite transformations and retained license hashes: ~~~sh python3 php_patcher.py verify ~~~ Install the preparation tools on Ubuntu, then verify the bundled payloads offline: ~~~sh sudo apt-get update sudo apt-get install --no-install-recommends python3 patch quilt dpkg-dev python3 php_patcher.py verify ~~~ See [BUILDING.md](BUILDING.md) for authenticated source acquisition and build dependencies. Inspect the source without changing it: ~~~sh python3 php_patcher.py inspect --source /path/to/unpacked-php-source ~~~ Prepare a new patched source directory: ~~~sh python3 php_patcher.py prepare \ --source /path/to/unpacked-php-source \ --output /path/to/prepared-source ~~~ The default revision is `parallax1`. Use `--maintainer 'Your Name '` to identify your local build. A package such as `8.5.11-1+ubuntu24.04.1+deb.sury.org+1` becomes `8.5.11-1+ubuntu24.04.1+deb.sury.org+1+parallax1`. PHP itself continues to report `8.5.11`. Package provenance identifies the security backport; the tool does not impersonate an upstream release. Build in the isolated Noble container: ~~~sh ./build.sh --source /path/to/prepared-source \ --output /path/to/artifacts/php-patched --jobs 4 ~~~ The output directory must be new, with a dedicated parent outside the source tree. Docker receives read-only source and tool mounts. Build dependencies are installed inside the container from the prepared source's `debian/control` using Ubuntu Noble repositories. Artifacts and failure diagnostics are returned with the invoking user's ownership. A native build is also available on Noble amd64: ~~~sh python3 php_patcher.py build --source /path/to/prepared-source \ --output /path/to/artifacts/php-patched --jobs 4 ~~~ The original source is copied into a build workspace. Normal packaging tests remain enabled. Independent security regressions must pass before the artifact directory is promoted. The explicit `--skip-regressions` option records missing regression validation; it is not equivalent to a tested build. ## Artifacts and installation A successful build includes the matching Debian binary package family, `SHA256SUMS`, build records, logs and `provenance.json`. Provenance records the upstream commit, patch checksum, original and local package versions, architecture, and regression status. Verify checksums in the artifact directory: ~~~sh sha256sum --check SHA256SUMS ~~~ Install only the destination machine's required matching packages: common files, CLI, FPM or Apache, and its installed bundled extensions. The tool does not install packages or change services automatically. `dpkg -i` does not fetch missing dependencies. Test extension loading, service configuration and applications before replacing a live runtime, then restart the affected PHP workers so they use the patched binaries. Retaining an upstream version and PHP API number does not establish compatibility for every external extension. A patch-applicability check or fixture build is not validation of a production PHP runtime. ## Source release After reviewing [VALIDATION.md](VALIDATION.md), create the allowlisted source archive: ~~~sh python3 make-release.py --plan python3 make-release.py (cd dist && sha256sum --check SHA256SUMS) ~~~ The default artifact is `dist/noble-patcher-for-php-0.1.0.tar.gz`. Packaging normalizes tar metadata and gzip timestamps. `SOURCE_DATE_EPOCH` can set the tar timestamp; its default is October 21, 2026 at 00:00 UTC. Private state, validation workspaces, caches and compiled packages are excluded. Archive creation does not publish it. ## Development and licensing Run the local tests with: ~~~sh python3 -m unittest discover -s tests -v ~~~ Original tool code and documentation use the [MIT license](LICENSE). Vendored PHP patches and embedded components retain their upstream licenses and notices; see [THIRD_PARTY.md](THIRD_PARTY.md). This community tool is not endorsed by the PHP Group or Zend Technologies. Version 0.1.1 recognizes the exact Sury PHP 8.5 source variant whose distribution patches already remove two tabs on blank lines. Whitespace matching is enabled only for its security patch, after matching the complete affected source file to its pinned SHA-256. Prerequisites and other sources retain strict matching; provenance records the compatibility profile. Patch-direction checks cannot silently switch direction.