On earlier Ubuntu versions (for example 20, or 22), some php versions are not supported out of the box. Maybe it's worth checking if the installation button can be disabled for PHP versions that are not supported.
Seems like this is already implemented for Ubuntu 18.