This is what I had to do, was in the same boat.
Go to /opt/fog/.fogsettings
Remove the sysv-rc-conf entry from the packages line from there. (Reference: https://github.com/FOGProject/fogproject/issues/797)
Lower down in the same file, set “php_ver=‘8.2’” to “php_ver=‘8.4’”
Exit and save.
Then I had to remove symlinks in Apache that were using the old php modules:
sudo unlink /etc/apache2/mods-enabled/php8.2.conf
sudo unlink /etc/apache2/mods-enabled/php8.2.load
Then add the new links:
sudo ln -s /etc/apache2/mods-available/php8.4.conf /etc/apache2/mods-enabled/php8.4.conf
sudo ln -s /etc/apache2/mods-available/php8.4.load /etc/apache2/mods-enabled/php8.4.load