This setup is intended for those who need to get their system up and running to do PHP web development. It is not recommended for production websites.
Install Apache
Open Terminal and type:
sudo apt-get install apache2
At the end of installation you will see a message saying:
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
It’s nothing to worry about because most personal computers don’t have one.
Test Apache
Open a web browser and point it to URL:
http://localhost/
You should see a message saying:
It works! This is the default web page for this server. The web server software is running but no content has been added, yet.
Install PHP
Open up Terminal again and type in the following command:
sudo apt-get install php5 libapache2-mod-php5
Test PHP
In the terminal, type this command:
sudo pluma /var/www/test.php
This will create a new php file in Pluma text editor. Copy/Paste this line into the .php file.
<?php phpinfo(); ?>
Save and close the file.
From a web browser, try to load the file:
http://localhost/test.php
It should render a page with all information on the PHP installation.
Install MySQL
Still in the Terminal, type this command:
sudo apt-get install mysql-server
You will be prompted with Configuring mysql-server dialog to setup a root password. It’s recommended that you set a password.
Install phpMyAdmin
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
In Configuring phpmyadmin window, press spacebar to check apache2 and press TAB key to move to
Choose
Test phpMyAdmin
From the browser, open this address:
http://localhost/phpmyadmin
You should see phpMyAdmin’s login page and be able to login using ‘root’ as Username and the password you setup earlier when you installed MySQL.
Further Reading
Installing LAMP (Linux, Apache, MySQL and PHP) On Linux Mint