You might be missing mysql module since it is not explicitly written down in IP docs. There should be two things: mysqli mysqlnd. If not install php7.2-mysql. AFAIK MariaDB is pretty much MySQL more or less so it should work.
Doing:
sudo service apache2 restart
doesn’t hurt.
For good measure check if you are not missing any more php modules that are listed as prerequisites.
If you get any more issues after this step with new output make sure you have your database credentials in database.php sorted out properly.