PARALLAX DISTRO — PHP 8.5.12 SOURCE BUILD Prepared for Ubuntu 24.04, 21 October 2026. For **Ubuntu 24.04**, the following builds PHP 8.5.12 and the modules in the example inventory into a separate installation. `php -m` identifies loaded modules, but doesn’t reveal extension versions, compile options, GD codecs, serializer support, or FPM configuration. Capture those before rebuilding. PHP 8.5.12 includes the October 21 security fixes, so installing that release incorporates those patches. [PHP security advisory](https://www.php.net/archive/2026.php#2026-10-21-5) Run these commands in Bash. Compile as an ordinary user; use `sudo` for package installation and `make install`. Start by recording the current installation: ```bash OLDPHP="$(readlink -f "$(command -v php)")" AUDIT="$HOME/parallax-builds/php-before-$(date +%Y%m%d-%H%M%S)" mkdir -p "$AUDIT" "$OLDPHP" -v > "$AUDIT/version.txt" "$OLDPHP" --ini > "$AUDIT/ini-paths.txt" "$OLDPHP" -m > "$AUDIT/modules.txt" "$OLDPHP" -i | grep -E '^(Configure Command|PHP API|PHP Extension Build|Zend Extension Build|Thread Safety|Debug Build|extension_dir)' \ > "$AUDIT/build.txt" for ext in gd readline igbinary msgpack redis memcached imagick imap swoole; do "$OLDPHP" --ri "$ext" > "$AUDIT/$ext.txt" done ``` If available, also save `--configure-options` from the **matching installation’s** `php-config`. Use those options to preserve features beyond the module names. [php-config documentation](https://www.php.net/manual/en/install.pecl.php-config.php) Install the Ubuntu build dependencies: ```bash sudo apt-get update sudo apt-get install -y \ build-essential autoconf automake libtool pkg-config \ bison re2c patch curl ca-certificates xz-utils \ libxml2-dev libsqlite3-dev libssl-dev libcurl4-openssl-dev \ libonig-dev libicu-dev libffi-dev libgmp-dev \ libreadline-dev libsodium-dev libxslt1-dev libzip-dev \ zlib1g-dev libpq-dev \ libpng-dev libjpeg-dev libfreetype-dev libwebp-dev libavif-dev \ libmagickwand-dev libmemcached-dev libsasl2-dev \ libc-client2007e-dev libkrb5-dev libsystemd-dev ``` The IMAP development package is available in Ubuntu Noble’s `universe` repository. [Ubuntu package details](https://packages.ubuntu.com/en/noble/libc-client2007e-dev) Download a clean source tree and verify its checksum: ```bash set -euo pipefail VER=8.5.12 BUILD_ID="${VER}-build1" PREFIX="/opt/php/$BUILD_ID" WORK="$HOME/parallax-builds/build-$BUILD_ID" JOBS=4 mkdir -p "$HOME/parallax-builds" # Both directories must be new. test ! -e "$PREFIX" mkdir "$WORK" cd "$WORK" curl -fL --retry 3 \ "https://www.php.net/distributions/php-${VER}.tar.gz" \ -o "php-${VER}.tar.gz" printf '%s %s\n' \ '81a0f450349e84b08eb43faa85f8a4c835684f3cc1c50471775d1317a046c525' \ "php-${VER}.tar.gz" | sha256sum --check - tar -xzf "php-${VER}.tar.gz" cd "php-${VER}" ``` That checksum applies specifically to the **8.5.12 `.tar.gz`** archive. [Official source downloads](https://www.php.net/downloads.php?source=Y) If you have an additional source patch, apply it **now, before configuring**. Otherwise, skip this block: ```bash PATCH_FILE=/absolute/path/to/reviewed-fix.patch sha256sum "$PATCH_FILE" patch --dry-run --batch --forward --fuzz=0 -p1 < "$PATCH_FILE" patch --batch --forward --fuzz=0 -p1 < "$PATCH_FILE" ``` Stop if the dry run fails; the patch may target another version or already be included. If it changes `configure.ac` or `config.m4`, regenerate the build configuration: ```bash ./buildconf --force ``` Configure PHP with the optional bundled modules from the example inventory: ```bash ./configure \ --prefix="$PREFIX" \ --with-config-file-path="$PREFIX/etc" \ --with-config-file-scan-dir="$PREFIX/etc/conf.d" \ --enable-cli \ --enable-fpm \ --with-fpm-systemd \ --with-fpm-user=www-data \ --with-fpm-group=www-data \ --enable-bcmath \ --enable-calendar \ --enable-exif \ --enable-ftp \ --enable-gd \ --with-jpeg \ --with-freetype \ --with-webp \ --with-avif \ --enable-intl \ --enable-mbstring \ --enable-pcntl \ --enable-shmop \ --enable-soap \ --enable-sockets \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --with-curl \ --with-ffi \ --with-gettext \ --with-gmp \ --with-mysqli \ --with-pdo-mysql=mysqlnd \ --with-pgsql \ --with-pdo-pgsql \ --with-openssl \ --with-readline \ --with-sodium \ --with-xsl \ --with-zip \ --with-zlib ``` Keep the normal defaults enabled: they supply the remaining bundled modules, including PDO, SQLite, DOM, SimpleXML, XMLReader, XMLWriter, fileinfo, and tokenizer. The GD codec options above are chosen defaults; compare them with your saved `gd.txt`. FPM is included for web serving, with pool configuration determining the actual worker user. For **PHP 8.5**, OPcache, URI, and Lexbor are built in. Don’t add `--enable-opcache` or an `opcache.so` loader. IMAP is built separately. [PHP 8.5 OPcache source](https://github.com/php/php-src/blob/php-8.5.12/ext/opcache/config.m4), [IMAP installation](https://www.php.net/manual/en/imap.installation.php) Build, inspect the test results, then install: ```bash make -j"$JOBS" make test # Continue after reviewing any test failures. sudo make install sudo install -d "$PREFIX/etc/conf.d" sudo install -m 0644 php.ini-production "$PREFIX/etc/php.ini" cp config.nice "$WORK/php-config.nice" "$PREFIX/bin/php" -v "$PREFIX/bin/php" --ini ``` This follows PHP’s documented source build workflow. [PHP build instructions](https://github.com/php/php-src/blob/php-8.5.12/README.md#building-php-source-code) The seven external extensions in this example are: | Extension | Source | Configure options | |---|---|---| | igbinary | [igbinary](https://github.com/igbinary/igbinary) | `--enable-igbinary` | | msgpack | [msgpack-php](https://github.com/msgpack/msgpack-php) | Defaults | | redis | [PhpRedis](https://github.com/phpredis/phpredis/blob/develop/INSTALL.md) | `--enable-redis` | | memcached | [php-memcached](https://github.com/php-memcached-dev/php-memcached) | `--enable-memcached` | | imagick | [Imagick](https://github.com/Imagick/imagick) | `--with-imagick` | | imap | [IMAP](https://github.com/php/pecl-mail-imap) | `--with-imap --with-kerberos --with-imap-ssl` | | swoole | [Swoole](https://github.com/swoole/swoole-src) | `--enable-swoole` | Download and extract pinned releases from those projects. Use the currently installed versions where they support PHP 8.5; record each archive’s version and checksum. Pin PHP 8.5-compatible extension releases from the linked upstream projects and record their checksums. Review current upstream support before rebuilding an extension. IMAP requires a non-thread-safe build and separate maintenance review. For **each extracted extension**, run this sequence, substituting its configure options from the table: ```bash export PATH="$PREFIX/bin:$PATH" "$PREFIX/bin/phpize" ./configure \ --with-php-config="$PREFIX/bin/php-config" \ --enable-igbinary make -j"$JOBS" make test sudo make install ``` The example builds igbinary. Always use these explicit `phpize` and `php-config` paths. [Official extension build procedure](https://www.php.net/manual/en/install.pecl.phpize.php) Build and load **igbinary and msgpack first**, then Redis and Memcached. If your saved extension information shows these serializer integrations, add: ```bash # Redis: --enable-redis-igbinary --enable-redis-msgpack # Memcached: --enable-memcached-igbinary --enable-memcached-msgpack ``` For Swoole, preserve the features shown by your saved `swoole.txt`. Common additional options are: ```bash --enable-sockets \ --with-openssl-dir=/usr \ --enable-swoole-curl \ --enable-mysqlnd ``` Check the pinned source’s `./configure --help` for its supported switches. Enable the installed extensions in dependency order: ```bash printf '%s\n' \ 'extension=igbinary.so' \ 'extension=msgpack.so' \ 'extension=redis.so' \ 'extension=memcached.so' \ 'extension=imagick.so' \ 'extension=imap.so' \ 'extension=swoole.so' | sudo tee "$PREFIX/etc/conf.d/20-external.ini" >/dev/null ``` Migrate your application’s existing INI settings into the new configuration. Remove old `extension_dir` overrides, old absolute `.so` paths, and loader lines for modules now compiled into PHP. Preserve serializer settings, timezone, memory limits, upload limits, and OPcache settings. Compare the finished module inventory: ```bash "$PREFIX/bin/php" -v "$PREFIX/bin/php" --ini "$PREFIX/bin/php" -m > "$WORK/modules-after.txt" normalise_modules() { sed '/^\[/d; /^[[:space:]]*$/d' "$1" | LC_ALL=C sort -u } diff -u \ <(normalise_modules "$AUDIT/modules.txt") \ <(normalise_modules "$WORK/modules-after.txt") ``` Resolve startup warnings and unexpected differences, then test database connections, cache serialization, image processing, IMAP, and Swoole features used by your applications. Before switching web traffic, discover the existing FPM service: ```bash systemctl list-units --all --type=service '*php*fpm*' systemctl cat ACTUAL_FPM_UNIT ``` Copy its FPM and pool configuration into the new installation, updating include paths while preserving pool users, sockets, permissions, and process settings. Validate it: ```bash "$PREFIX/sbin/php-fpm" \ -t \ -y "$PREFIX/etc/php-fpm.conf" ``` Test the new FPM through a separate socket or staging route. Then update the discovered service’s executable/configuration paths and **restart it**. Also restart persistent queue, Horizon, Octane, or Swoole processes using the new PHP binary. Keep the previous installation and service configuration for rollback. For later PHP patch releases, use a fresh source tree, a new installation prefix, the new published checksum, and repeat the build, extension rebuild, and validation process. These are source-build instructions, not a record of a completed installation. Validate the resulting runtime against your own application and service configuration before activation.