PHP2Shell.fyi Check a site

PHP2Shell on Ubuntu

Ubuntu fixes PHP2Shell in its own PHP packages and keeps the old PHP number. On Ubuntu 24.04 the fixed package is 8.3.6-0ubuntu0.24.04.13, and PHP still calls itself 8.3.6. Compare the package version, then restart PHP.

Last reviewed . Rules of .

Fixed packages

Install the version for your release, or a newer one. The fix is in every binary package of the branch. The website uses the -fpm, -cgi or libapache2-mod-php package, not -cli.

Source: Ubuntu USN-8948-1 and USN-8948-2. Checked 2026-10-22.
ReleasePackageFixed versionNotice
26.10php8.58.5.9-0ubuntu2.1USN-8948-1
26.04 LTSphp8.58.5.4-0ubuntu1.5USN-8948-1
24.04 LTSphp8.38.3.6-0ubuntu0.24.04.13USN-8948-1
22.04 LTSphp8.18.1.2-1ubuntu2.28USN-8948-1
20.04php7.47.4.3-4ubuntu2.29+esm5USN-8948-2. Needs Ubuntu Pro.
18.04php7.27.2.24-0ubuntu0.18.04.17+esm14USN-8948-2. Needs Ubuntu Pro.
16.04php7.07.0.33-0ubuntu0.16.04.16+esm22USN-8948-2. Needs Ubuntu Pro with the Legacy Support add-on.
14.04php55.5.9+dfsg-1ubuntu4.29+esm18USN-8948-2. Needs Ubuntu Pro with the Legacy Support add-on.
25.04, 25.10—noneEnd of life. Not in the notices. Upgrade the release.

USN-8948-1 lists these binary packages for each branch: php8.3-fpm, php8.3-cgi, php8.3-cli and libapache2-mod-php8.3 (use your branch).

On 20.04 and 18.04 the fix comes through Ubuntu Pro. On 16.04 and 14.04 it needs Ubuntu Pro with the Legacy Support add-on. Without them, apt upgrade does not install the fix. Run pro status to see whether Pro services are on.

See the installed build

# every installed PHP package and its version
    dpkg -l 'php*' 'libapache2-mod-php*' | grep '^ii'
    # installed and candidate version, and where it comes from
    apt policy php8.3-fpm

Use your branch in the package name: php8.1 on 22.04, php8.3 on 24.04, php8.5 on 26.04 and 26.10. A server can have more than one branch, so check each one.

Read the Installed: line of apt policy. If it is lower than the table, the fix is missing. The lines below it show where the package comes from. If it is not an Ubuntu archive (archive.ubuntu.com, security.ubuntu.com or esm.ubuntu.com), for example a PPA, the table does not apply. That PHP uses upstream numbers: compare it with the fixed releases.

Install the update

sudo apt update
    # only the PHP packages that are installed (use your branch)
    sudo apt install --only-upgrade php8.3-fpm php8.3-cli php8.3-cgi libapache2-mod-php8.3
    # or everything
    sudo apt upgrade

--only-upgrade skips packages that are not installed.

Restart PHP

sudo systemctl restart php8.3-fpm
    # Apache with mod_php, or Apache in front of PHP-FPM
    sudo systemctl restart apache2

A running PHP process keeps the old code in memory until it stops. Restart Apache, every PHP-FPM pool and any long-running PHP workers, such as queue workers (php2shell.com). In a container, rebuild the image and recreate the container (our advice).

To see that PHP-FPM started after the update, compare the two times (our advice):

# when the package was upgraded
    zgrep ' upgrade php8.3-fpm' /var/log/dpkg.log*
    # when PHP-FPM last started: must be later
    systemctl show -p ActiveEnterTimestamp php8.3-fpm

php -v does not show the fix

To find what serves the site: ls /run/php/ lists the PHP-FPM sockets, such as php8.3-fpm.sock. apache2ctl -M | grep php shows whether Apache loads mod_php. A short phpinfo() test shows the branch and the Server API.

Check your site

The php2shell.fyi checker reads the PHP version your site shows in public. A header is a hint, not proof. A distribution build often reports an old number, so confirm the package version on the server. A result never proves that a site is not exposed.

Sources