PHP8 is coming and developers of major softwares like Tiki started to rewrite and adapt code that will be released in the future stable versions.
It is already included in the last Virtualmin upgrade and will be used by default for the Linux Command Line Interface (CLI). If you install a Tiki 21 or a Tiki 22 this may trick the CLI setup.sh install script.
But as it is documented at the Tiki Dev Composer page it is possible to tell the script which PHP to use. To do so you have to give the path of the CLI you want to use.
/usr/bin/phpversion as installed by virtualmin you can check the content of the usr/bin directory to find the right folder name for the version you want to use
ls -l /usr/bin/
In my case I have several version installed and using mainly Tiki 22 now I use PHP7.4 so the complete command will be:
sh setup.sh -p /usr/bin/php7.4
Once the install script complete, don't forget to set permission (f) and then you can start to configure your Tiki and set its database.