> For the complete documentation index, see [llms.txt](https://docs.up-network.ch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.up-network.ch/documentation/en/guides/update-php-and-kernel.md).

# 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.

{% hint style="info" %}
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.
{% endhint %}

Before any major update, create a [backup or snapshot](https://docs.up-network.ch/documentation/en/guides/backups-and-restoration) of your server.

## Check your PHP version

Connect over SSH and run:

```bash
php -v
```

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

```bash
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.

{% hint style="warning" %}
The **official Debian, Ubuntu or AlmaLinux packages** often keep their original version number but include the security fixes. An older number therefore does not necessarily mean PHP is vulnerable: check your distribution’s security advisory to find the fixed package version.
{% endhint %}

## 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):

```bash
sudo apt update
sudo apt upgrade
```

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

```bash
sudo systemctl restart php8.3-fpm
sudo systemctl restart apache2   # or nginx
```

### AlmaLinux, Rocky Linux and other RHEL distributions

These commands also work with the Remi repository:

```bash
sudo dnf upgrade --refresh 'php*'
sudo systemctl restart php-fpm
sudo systemctl restart httpd   # or nginx
```

### 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:

```bash
docker compose pull
docker compose build --pull
docker compose up -d
```

### Check the result

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

```bash
systemctl status php8.3-fpm
```

## 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:

   ```ini
   session.upload_progress.enabled = 0
   ```
2. With **PHP 8.5**, also add:

   ```ini
   fatal_error_backtraces = 0
   ```
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

```bash
sudo apt update
sudo apt full-upgrade
```

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

### AlmaLinux, Rocky Linux and other RHEL distributions

```bash
sudo dnf upgrade --refresh kernel
```

### 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.

```bash
sudo reboot
```

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

```bash
uname -r
```

## 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](https://docs.up-network.ch/documentation/en/infrastructure/support) offer. For any question, [open a support ticket](https://docs.up-network.ch/documentation/en/guides/how-to-open-a-support-ticket).
