Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update PHP and the Linux kernel

On a VPS or dedicated server, you manage the operating system and installed software yourself. This guide explains how to apply the security fixes for PHP and the Linux kernel, for example after the PHP2Shell and PwnEscape vulnerabilities of October 2026.

Are you using our Plesk web hosting? UP-NETWORK manages PHP for you: fixed versions are installed automatically as soon as they are released. This guide does not apply to you.

Before any major update, create a backup or snapshot of your server.

Check your PHP version

Connect over SSH and run:

php -v

If you use PHP-FPM, also check the installed versions and active services:

ls /etc/php/ 2>/dev/null
systemctl list-units --type=service | grep -i php

Compare the result with the fixed versions released by the PHP project. For PHP2Shell, these are 8.2.35, 8.3.36, 8.4.27 and 8.5.12 or later.

Update PHP

Debian and Ubuntu

These commands work for the distribution packages as well as for the common third-party repositories by Ondřej Surý (packages.sury.org for Debian, the ondrej/php PPA for Ubuntu):

sudo apt update
sudo apt upgrade

Then restart PHP-FPM, adjusting the version number to the one you use, and your web server:

AlmaLinux, Rocky Linux and other RHEL distributions

These commands also work with the Remi repository:

With a control panel

If you installed a control panel on your server yourself, update PHP from that panel:

  • Plesk: Tools & Settings → Updates, then install the available PHP component updates.

  • cPanel / WHM: EasyApache packages are updated with the system updates. Run them from WHM or with dnf upgrade.

With Docker

Rebuild your images from an up-to-date PHP image, then redeploy your containers:

Check the result

Run php -v again and check the version shown. If you use PHP-FPM, make sure the service has been restarted:

Until you can update: temporary measures

If you cannot update immediately, you can reduce the risk related to PHP2Shell. These measures do not replace the update.

  1. In your php.ini file or in your PHP-FPM pool configuration, add:

  2. With PHP 8.5, also add:

  3. Restart PHP-FPM or your web server. A setting made in the application code with ini_set() is not enough.

Update the Linux kernel

Updating the kernel regularly is good practice on any server. It is essential if you run your own virtual machines, for example with Proxmox VE or KVM/libvirt on a dedicated server: your server is then a hypervisor, affected by vulnerabilities such as PwnEscape.

Debian, Ubuntu and Proxmox VE

On Proxmox VE, the apt dist-upgrade command is equivalent.

AlmaLinux, Rocky Linux and other RHEL distributions

Restart and check

A new kernel only becomes active after a restart. If your server hosts virtual machines, notify their users, shut them down cleanly or migrate them before restarting.

After the restart, check the version of the running kernel:

Need help?

UP-NETWORK does not work directly on unmanaged VPS and dedicated servers. If you would rather have us handle these updates, discover our Support and managed services offer. For any question, open a support ticket.