Updating php on server

I was having trouble getting a new vagrant box going for an older Trellis project, so I rebased over the latest Trellis master, which uses php v8 as opposed to v7.4, which the servers are provisioned with.

I can get around the Unable to start service php8.0-fpm error by reverting the php_version version in group_vars/all/main.yml.

As opposed to spinning up new servers, is there a recommended way to re-provision php on the staging and production servers.

Can I just update php_version and run trellis provision --tags "php, nginx" staging?

You can ssh onto server and run sudo update-alternatives --config php which will keep the version, I believe.
Additionally, you may need to set install_recommends: no in trellis/roles/php/tasks/main.yml to prevent a bug where some recommendations were causing version to upgrade to 8.0.

Thanks, man. However, I’m actually wondering what is a good way to upgrade php to 8.0 on the servers. Just remotely with apt?