Install and configure Apache, PHP, MySql and phpMyadmin (LAMP) on Linux Mint 18.2

LAMP named as an acronym of the Linux operating system, the Apache HTTP Server, the MySQL relational database management system and the PHP programming language.

L – Linux
A – Apache
M – MYSQL
P – PHP

Step 1:
Installing apache

 

The Apache HTTP Serveris the world’s most used web server software. Open Terminal. To open terminal click the Main Linux Mint Menu, then go to system tools and select Terminal or type terminal in the search field or click the Terminal icon in taskbar. And type the below code in terminal and hit enter.

sudo apt-get install apache2

Type your linux mint password and press enter.

Type y and hit enter to confirm apache installation.

 

After the successful installation , open your favorite browser and type

http://localhost/

in the address bar and press enter. If you will see ‘It works!’  in the Apache2 Ubuntu Default Page, then your apache works fine.

apche2
Step 2:
Installing PHP

<a
PHP is a server-side scripting language. To install php on linux mint open terminal and type the below code in terminal and hit enter.

sudo apt-get install php-mbstring php7.0-mbstring php-gettext

Type your linux mint password if needed.

Type y and hit enter to confirm PHP installation. This will install the latest php version that is 7 on linux mint.

After the successful installation restart Apache using the below code

sudo /etc/init.d/apache2 restart

or

sudo service apache2 restart

 

 

Test PHP installation

Now to test PHP is installed, open your favorite browser and type

http://localhost

in the address bar and press enter. If you will see the below page , then your php works fine.

php
To check the installed PHP version in terminal, type the below command in terminal and hit enter.

php -v


Step 3:
Installing MySql

To install Mysql in your linux mint system, open terminal. And type the below code in terminal and hit enter.

sudo apt-get install mysql-server

Type your linux mint password if needed.

Type y and hit enter to confirm MySql installation.

During the installation you will be prompted for a password. Choose something secure and type the password and hit enter.

If asked again, repeat the password and press enter.

 

To install the mysql client, type the below command in terminal and press the enter key in your keyboard

sudo apt-get install mysql-client

 

Step 4:
Installing phpMyadmin

phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web.

Open your terminal. And type the below code in terminal and hit enter.

sudo apt-get install phpmyadmin

Type your linux mint password if needed.
Type y and hit enter to confirm phpMyadmin installation.

During the installation you will be prompted for a webserver configuration. Select apache2 by pressing space button

(already selected) press enter.

Now  you will be prompted for a configure database for phpmyadmin wjth dbconfig-common.

Select ‘Yes’ to configure database for phpmyadmin wjth dbconfig-common.

config-phpmyadmin

Now you will be promped for phpmyadmin configuration. Type your mysql application password for phpmyadmin
and press the down arrow key to point ok and hit the enter key.

config-phpmyadmin

Again confirm the password and press OK.

config-phpmyadmin

restart your apache server using

sudo service apache2 restart

Type your linux mint password if needed. And restart your pc.

Open your browser and type

http://localhost/phpmyadmin/

in the address bar and press enter. It will open the phpmyadmin admin login page
Type your mysql root username and password to login.

phpmyadmin

Advertisements

5 thoughts on “Install and configure Apache, PHP, MySql and phpMyadmin (LAMP) on Linux Mint 18.2

  1. Hi, thanks for this tuto.
    When I try to load phpmyadmin i see brut php code who’s not interpreted, but php is loaded in apache2 loaded modules, someone have an idea please ?

  2. For Linux mint 19 need to use this command for phpmyadmin workable.
    sudo apt-get install php libapache2-mod-php php-mysql

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.