The documentation for 2.x mentions the mysql extension for php is required. This is only true when using mariadb or mysql.
Also, at least in php 8.4 a lot of extensions have been changed/renamed:
Note, selecting 'php8.4-xml' instead of 'php8.4-dom'
Note, selecting 'php8.4-common' instead of 'php8.4-fileinfo'
Note, selecting 'php8.4-common' instead of 'php8.4-tokenizer'