Upgrade of Snipe-IT fails when upgrading from version 6 to 7 using php 7 or 8.2

Upgrade of Snipe-IT fails when upgrading from version 6 to 7 using php 7 or 8.2

I was using Snipe-IT version 6 on Ubuntu running php7.4 and upgrading fails because Snipe-IT version 7 and later requires php8.1 or higher. But when I tried to upgrade to php8.2 first the upgrade failed. The solution seems to be to upgrade to php8.1 first and then upgrade Snipe-IT to version 7. After that you can upgrade to php8.2 if you want to.

Follow this guide to upgrade your php on Ubuntu to 8.1 in order to complete the upgrade of Snipe-IT.

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php8.1
sudo apt install php-common php8.1-apcu php8.1-cli php8.1-common php8.1-curl php8.1-fpm php8.1-mysql php8.1-opcache php8.1-readline

sudo a2dismod php7.4
sudo a2enmod php8.1

php -v

sudo update-alternatives --config php

sudo systemctl restart apache2