Patch DCA PHP on Oracle Linux 9.x
patch.ol9.to.php.8.3.36.sh updates an existing system PHP 8.3 installation in place to
8.3.36 or a newer stable 8.3 release, fixing CVE-2026-109618 and
CVE-2026-109619. It supports Oracle Linux 9.x, including 9.4, with the DCA's
php-fpm.service. It keeps the selected module stream and existing settings.
The upstream minimum is deliberately strict: an older vendor build with a
backported fix is rejected because this script cannot independently prove the
backport. PHP 7.x/8.0/8.⅛.2/8.4/8.5, containers, custom binaries, and
side-by-side php83-* packages require a separate update procedure.
Run on the appliance
Scope: this script covers Oracle Linux 9.x DCA appliances only. Other PHP
instances, including the demo host running MAMP, deploy-docker images built
from php:8.3-fpm, and developer machines, need their own updates.
Copy the script to the appliance, then run:
sudo bash ./patch.ol9.to.php.8.3.36.sh --check
sudo bash ./patch.ol9.to.php.8.3.36.sh --apply
The deploy/ directory is excluded from normal DCA rsync deployment, so copy
the script explicitly. From the repository root, this ad-hoc command uses the
repository's Ansible configuration (become = True):
ansible DCAs -i ansible/inventory/hosts.local -m script -a "deploy/patches/php.8.3.36/patch.ol9.to.php.8.3.36.sh --check" --limit <host>
The default --check downloads packages, checks signatures and PHP build
consistency, and runs DNF's RPM transaction test to verify dependencies. It changes
no installed packages or PHP settings, and restarts no
services. It does write DNF cache and root-only audit files under
/var/tmp/wcs-php-update.*. An apply run downloads and validates again.
Each run lists staged package names and exact builds in its output and
update.log, or explicitly reports that nothing is staged. curl is required
in both modes; Oracle Linux 9's curl-minimal provides it.
Use a maintenance window and take an appliance/VM snapshot before applying.
After staging, transaction preflight, and backup, the script stops active Apache
first, then PHP-FPM, and verifies they have stopped before installing packages.
It tests the installed PHP version, extensions, FPM configuration, and Apache
configuration while services are stopped. Only after those tests pass does it
start and verify PHP-FPM, then start Apache if Apache was initially active.
An initially inactive Apache service is left inactive. This interrupts requests
for the duration of installation and testing.
Required dependencies may be updated
along with PHP; the script does not perform a general operating system update,
switch streams, disable signature checking, or pass --allowerasing.
DNF/RPM configuration-file handling remains in effect; review .rpmnew and
.rpmsave files after installation. No security INI overrides are added.
Caddy is the public front end and is deliberately left running. While FPM is
down, PHP requests through Caddy answer 502 and agents retry. Apache on port 81
is stopped because it loads mod_php. After startup, the script waits up to ten
seconds for the configured Unix FPM socket, then makes one request to /
through active Caddy at http://127.0.0.1/, or through initially active Apache
at http://127.0.0.1:81/ if Caddy is inactive. It logs the HTTP status and accepts
only 2xx/3xx. This checks basic front-end reachability, without login; it does
not prove that a PHP page executed or that application features work. If neither
front end is active, the HTTP check is explicitly skipped. A TCP FPM listener
does not receive the Unix socket existence check.
Repository mode selects only packages built from PHP core. PECL and PEAR packages are not selected for update; the PHP ABI does not change within 8.3, so they need no rebuild. DNF may resolve additional required dependencies; new dependency packages are named explicitly in the run log.
If the repository does not yet have the fix
The PHP announcement on October 21, 2026 says Remi will not have the security
updates that day. A successful ordinary dnf update is therefore insufficient.
The script refuses to install a transaction that would leave PHP below 8.3.36.
An unavailable package or unresolved dependency is an error, not success.
All enabled repositories must be reachable because the script uses
--setopt='*.skip_if_unavailable=False'. An unrelated mirror outage can
therefore fail a run even when the PHP fix exists. Failure to list an enabled
PHP module is recorded as a non-modular installation and is non-fatal; the
script never enables or switches streams.
If approved, signed PHP 8.3 RPMs are obtained separately, supply the entire compatible bundle, including updated core extensions and required dependencies:
sudo bash ./patch.ol9.to.php.8.3.36.sh --check --rpm-dir /root/php-security-rpms
sudo bash ./patch.ol9.to.php.8.3.36.sh --apply --rpm-dir /root/php-security-rpms
Offline bundles may add PHP core subpackages, but each non-core package must
already be installed by name. An unrelated new package such as nano is
rejected even with a trusted signature. Install a genuinely new non-core
dependency separately before retrying the bundle. The complete staged package
listing is available before the transaction test. Every RPM must have a
valid signature from a key already trusted by RPM. Approved vendor keys must be
verified and imported separately. The script does not install repository files
or import keys. Offline installation has all repositories disabled. It does not
compile PHP from source or mix a different PHP minor branch into the appliance.
If the fix is unavailable, keep the appliance access-restricted and apply the advisory's temporary mitigations separately until a patched build can be installed.
Verification and recovery
Before installation, the script records installed package builds and loaded CLI
extensions, tests FPM configuration, and backs up /etc/php.ini, /etc/php.d,
/etc/php-fpm.conf, /etc/php-fpm.d, and the PHP module selection when present.
It validates staged RPM signatures, minimum PHP version, and matching builds for
all installed packages originating from the PHP source RPM.
After installation it verifies installed core builds, CLI and FPM binary versions, retention of CLI extensions, FPM configuration, and a restarted, active FPM master whose executable matches the updated system binary. An already-fixed appliance is still restarted in apply mode. An initially active Apache service also has its configuration tested before/after installation and is stopped/started to replace any loaded PHP module. The script requires an initially active FPM service using the current on-disk executable. If a prior package update has left FPM executing a deleted/old binary, restart and verify FPM before running it.
After services start, the configured Unix FPM socket must appear within ten
seconds. When a front end is available, one HTTP request to / must return
2xx/3xx. This unauthenticated request may serve static content and does not
prove PHP execution, authenticated application health, or agent API behavior.
Afterward verify DCA login, endpoint/agent lookups, exports, avatar/certificate
uploads, and the appliance-specific extensions and FPM pool settings. Check
systemctl status php-fpm and the PHP-FPM error log for startup warnings.
The root-only audit directory includes update.log, package inventories, signature
results, and (in apply mode) config-before.tar. Copy it to durable administrative
storage if required; /var/tmp retention depends on host policy. It contains
potentially sensitive configuration. The backup is not a package or VM snapshot.
If installation or pre-start post-update tests fail, the script exits nonzero and leaves
the stopped services down for investigation. A failure to stop a service aborts
before package installation. It also aborts if an RPM scriptlet unexpectedly
starts a service before testing. It does not automatically downgrade to a
vulnerable release, overwrite configuration, or start services after a failed
installation or test. If starting a service fails after tests pass, inspect both
service states; PHP-FPM may already be running. Inspect the audit log and
dnf history info last; keep traffic restricted until FPM and DCA pass checks.
Restore configuration selectively or use the pre-update appliance snapshot if
recovery requires it. A partial RPM transaction must be investigated before retry.
If the socket or HTTP check fails after startup, the script exits nonzero with
the HTTP status logged when a request was attempted. Both httpd and php-fpm may
be running and must be inspected; this failure does not stop either service.