Last verified ·

PHP2Shell step-by-step response

Commands are examples for the stated environment. Match the branch, service and paths to your site; prepare a backup and a maintenance window before changing production.

Operation map - an illustration, not a screenshot of your installation
  1. Find the Web runtime

    WordPress: Tools > Site Health > Info > Server. In a panel, select the domain and its assigned handler. With SSH, map the vhost/socket to its FPM service or container. php -v and php --ini describe CLI only. Never publish phpinfo().

    CLI / systemd
    php -v
    php --ini
    ps -eo pid,lstart,args | grep -E '[p]hp-fpm|[a]pache2|[h]ttpd'
    systemctl list-units --type=service --all | grep -E 'php.*fpm|apache2|httpd'
  2. Prepare a recoverable change

    Save site files, database, PHP configuration, extensions and the current image/package revision. Test restoring a copy. Record login, upload, checkout and scheduled-job checks before the change.

  3. Ubuntu / Debian: inspect, then update

    List installed PHP packages and their repository/candidate versions. The example is PHP 8.3 FPM; adapt it for your installed branch and extensions. For mod_php update the matching libapache2 package and restart Apache. Do not blindly add a new repository.

    PHP 8.3 FPM · Debian / Ubuntu
    dpkg-query -W -f='${Package} ${Version}\n' 'php*' 'libapache2-mod-php*'
    sudo apt update
    apt-cache policy php8.3-common php8.3-fpm php8.3-cli
    sudo apt install --only-upgrade php8.3-common php8.3-fpm php8.3-cli
  4. Prove a distribution patch

    Ubuntu 24.04 can still report PHP 8.3.6 after patching: USN-8948-1 specifies 8.3.6-0ubuntu0.24.04.13. Match OS release, repository, package revision and BOTH CVEs. Debian has its own tracker. A missing changelog entry is inconclusive; get vendor evidence.

    PHP 8.3 · Debian / Ubuntu
    dpkg-query -W php8.3-common php8.3-fpm
    zgrep -Ei 'CVE-2026-109618|CVE-2026-109619' /usr/share/doc/php8.3-common/changelog.Debian.gz
    USN-8948-1 · CVE-2026-109618 / CVE-2026-109619
    Ubuntu releasePHPFixed vendor package revision
    26.10php8.58.5.9-0ubuntu2.1
    26.04 LTSphp8.58.5.4-0ubuntu1.5
    24.04 LTSphp8.38.3.6-0ubuntu0.24.04.13
    22.04 LTSphp8.18.1.2-1ubuntu2.28
  5. Replace the processes serving requests

    Validate the configuration, then restart the actual FPM service or Apache for mod_php during maintenance. Replace container replicas and restart long-running workers. A configuration saved on disk does not prove old processes have stopped.

    PHP 8.3 FPM · Debian / Ubuntu
    sudo php-fpm8.3 -t && sudo systemctl restart php8.3-fpm
    systemctl is-active php8.3-fpm
    systemctl show php8.3-fpm -p ActiveEnterTimestamp
    ps -eo pid,lstart,args | grep '[p]hp-fpm'
  6. Verify the fix on the running website

    Retain runtime/build evidence for both CVEs, restart timestamps and every pool/replica checked. Re-test business functions and effective temporary settings. A hidden response header or a clean URL-check result proves neither patching nor absence of compromise.

Ubuntu & Debian

Identify the installed php*-common package and the Web handler’s package, then consult the Ubuntu or Debian security tracker for both CVEs. The commands below use PHP 8.3 as an example; substitute your actual branch. Ensure the enabled repository offers a fixed revision before upgrading. If a package changelog is unavailable or does not mention the CVE, obtain the vendor advisory rather than treating silence as a clean result.

Distribution versions and backports

Ubuntu, Debian and enterprise Linux vendors often retain an older upstream number while adding security patches to a package revision. A banner such as 8.3.6 does not prove that a machine is vulnerable or fixed. Match the OS release, repository, architecture and installed revision to the vendor’s status for BOTH CVEs. This site deliberately does not invent package cutoffs.

3. Restart and verify every instance

Installing a new binary leaves old worker processes in memory until they exit. Restart Apache for mod_php or the corresponding PHP-FPM services and pools. Restart queue workers and scheduled long-running processes too. Verify service start times, Web runtime version, package revision, health checks and every load-balanced replica. Delete any temporary diagnostic page immediately; do not leave phpinfo() publicly accessible.

Command example / DEBIAN

shell
dpkg-query -W -f='${Package} ${Version}\n' 'php*-common'
apt-cache policy php8.3-common php8.3-fpm
# Search your installed package's security changelog.
zgrep -Ei 'CVE-2026-109618|CVE-2026-109619' \
  /usr/share/doc/php8.3-common/changelog.Debian.gz

Command example / APT

shell
sudo apt update
apt list --upgradable
# Example: installed PHP 8.3 packages; use your actual branch.
sudo apt install --only-upgrade php8.3-common php8.3-fpm php8.3-cli
sudo systemctl restart php8.3-fpm
systemctl status php8.3-fpm --no-pager

Primary sources & further reading

PHP security teamSecurity advisory · 21 Oct 2026
CVE-2026-109618GHSA-w8hw-w9fx-j79w · OOM corruption
CVE-2026-109619GHSA-6wmf-4rv5-p3rp · Stale global state
Ubuntu security trackerCVE-2026-109618 · Distribution package status
Debian security trackerCVE-2026-109618 · Distribution package status
Next step3. Restart and verify every instance ↗