Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Upgrade PHP Version on Ubuntu

Upgrading PHP improves security and performance. On Ubuntu LTS the usual path is Ondřej's PPA.

Steps

  1. Add the PPA and install the target version (8.3 example):

    sudo apt update
    sudo apt install -y software-properties-common
    sudo add-apt-repository -y ppa:ondrej/php
    sudo apt update
    sudo apt install -y php8.3-fpm php8.3-mysql php8.3-xml php8.3-curl php8.3-mbstring
  2. Check the CLI version and that FPM is running:

    php8.3 -v
    sudo systemctl enable --now php8.3-fpm
  3. In Nginx, switch the PHP socket (example) and reload:

    fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    sudo nginx -t && sudo systemctl reload nginx
  4. Optional: disable the old FPM once everything works:

    sudo systemctl disable --now php8.1-fpm

Tips

  • Smoke-test the site after switching — plugins and Laravel may need extra extensions.
  • Do not mix several PHP versions on one vhost unless you know which FPM it uses.

ext step

A VPS ready for your PHP stack: Deploy your Cloud VPS.

Related guides