switch PHP version

a2dismod php8.1

service apache2 restart

a2enmod php8.2

service apache2 restart

And change php-cli

update-alternatives –config php