Thank you for replying.
OK, most likely I need to contact the CasaOS developers and check if their NextCloud installation script might have any issues. CasaOS is a Debian server distribution and is very well known. I am not a Linux expert to go and verify if all components needed for NextCloud were installed correctly.
I usually install entire package (that is including web server, PHP and MySQL so I do not have to deal with the details). I did the same using DietPi version of Next Cloud. I went through the installation without issues, so it seems that something got missing when running CasaOS script.
I think it would be great to add some small script to verify if (and what version) of PHP/MySQL/WebServer is installed, right before )or on) the setup page. It would help avoid situation like this.