I couldn't find a complete solution to the problem but here is one way to install:
sudo apt update
sudo apt -y upgrade
sudo apt install apache2
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
sudo apt update
sudo apt install php8.1
------------------------------------------
when clogged press ctrl+z
------------------------------------------
sudo reboot
sudo dpkg --configure -a
sudo apt install php8.1-{bcmath,fpm,xml,mysql,zip,intl,ldap,gd,cli,bz2,curl,mbstring,pgsql,opcache,soap,cgi}
sudo apt -y upgrade
Apache + Mysql + Php 8.1