Critical PHP CVEs: how to update PHP on a VPS or dedicated server
Update the PHP runtime that serves web requests. These two PHP core vulnerabilities can allow unauthenticated remote code execution. This guide applies to self-managed VPS hosting and dedicated servers. The update method depends on how PHP was installed.
What the vulnerabilities do
Section titled “What the vulnerabilities do”- CVE-2026-109618. An out-of-memory error can interrupt initialization of PHP’s internal request data. During request shutdown, PHP can then treat incomplete data as valid and corrupt memory. PHP advisory
- CVE-2026-109619. Global state can retain a reference to freed request memory. A later request handled by the same worker can use that stale reference before PHP resets it. PHP advisory
Web runtimes include PHP-FPM, Apache mod_php, CGI, FrankenPHP and LiteSpeed. The PHP Group demonstrated a mod_php scenario that can run before application code. Updating WordPress or its plugins alone does not fix the PHP runtime. PHP security announcements
Which PHP version to install
Section titled “Which PHP version to install”The first upstream releases fixing both CVEs are 8.2.35, 8.3.36, 8.4.27 and 8.5.12. Install the latest security release of a compatible, supported branch. Linux distributions may backport fixes while retaining an older upstream version number. Compare the full installed package revision with your vendor’s advisory. For PHP 8.1 or earlier, use a vendor build confirmed to include the patches or migrate to a supported branch.
- Ubuntu USN-8948-2
- Debian trackers for CVE-2026-109618 and CVE-2026-109619
- Red Hat RHSB-2026-013
Update PHP on your server
Section titled “Update PHP on your server”-
Identify the PHP installation used by each site and pool. Check application and extension compatibility, and back up configuration and data. The CLI version alone does not identify the web runtime.
Terminal window cat /etc/os-releasephp -vsystemctl list-units --type=service 'php*-fpm.service' 'httpd.service' 'apache2.service' -
Ubuntu or Debian with APT-managed PHP. This example assumes an existing PHP 8.3 FPM installation. Substitute your installed branch, confirm the candidate against the vendor advisory and include your installed extensions for that branch.
Terminal window sudo apt updateapt-cache policy php8.3-fpm php8.3-cli php8.3-commonsudo apt install --only-upgrade php8.3-fpm php8.3-cli php8.3-commonsudo systemctl restart php8.3-fpmFor Apache mod_php, update the matching module package, such as
libapache2-mod-php8.3, and restartapache2. On RHEL-family systems, check the active stream and repository against the vendor advisory, review the transaction fromsudo dnf upgrade 'php*', then restart the activephp-fpmorhttpdservice as appropriate. -
DirectAdmin CustomBuild. Check every PHP branch assigned to domains. Refresh CustomBuild metadata and rebuild the affected PHP branches following the DirectAdmin PHP documentation. Updating system packages through APT or DNF does not update separate CustomBuild installations.
-
Docker. Update the base image to a confirmed fixed tag or digest. Rebuild and replace PHP containers while preserving persistent volumes. Verify the runtime inside the replacement containers.
Verify the update
Section titled “Verify the update”Compare the installed packages with the vendor advisory. Confirm the running web PHP version for each site using the control panel or protected diagnostics, then check HTTP responses, login, uploads and error logs. Remove any temporary diagnostics. If patching is delayed, restrict public access to affected applications. If compromise is suspected, isolate the system and preserve logs. Patching does not remove an existing compromise.