First of all. Make sure you are using an user with permissions so that you can use commands such as 'apt-get' etc.
root@petrosky:/# apt install apache2
root@petrosky:/# apt install mariadb*
root@petrosky:/# mysql_secure_installation
You will be prompted whether to set a password or not. We highly recommend setting up a password for the 'root' DB User and disabling Remote SQL Connections.
root@petrosky:/# apt install php libapache2-mod-php