You can watch the following video for reference:
The steps are as follows:
1. Apache server
sudo apt install apache2
you can type: http://localhost to see if apache works
2. Install the PHP interpreter, add PHP support for Apache
sudo apt install php libapache2-mod-php
then go to /var/www/html and set the correct read/write permissions for our current user:
sudo chown $USER:$USER /var/www -R
create a new file index.php with:
echo "hello from php";
?>
and test in the browser http://localhost - you should be able to see the output: hello from php
3. Mysql server
sudo apt install mysql-server php-mysql
this will install the MySQL server as well as enable PHP to run MySQL queries
sudo mysql_secure_installation
will set our initial root password
just set the password and answer Y to flush privileges to be able to apply the new password to MySQL.
sudo mysql
to ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'.
this will enable password authentication and set the MySQL root password to password.
Exit the MySQL client and lets test with mysql -uroot -p
and then enter the password: password
4. PHPMyAdmin
install composer via: sudo apt install composer
install minimum required libraries for PHPMyAdmin: sudo apt install php-xml php-zip
fetch and install PHPMyAdmin: composer create-project phpmyadmin/phpmyadmin
Congratulations and enjoy the course!