You are on page 1of 7

How to install and configure

Apache,PHP,MySql and phpMyadmin on


ubuntu

GroupAID Support Systems Inc. | GroupHUB, 25-32 New Capitol Estates 1, Batasan Hills, Quezon City, Philippines
Step 1:
Installing apache

Go to Application → Accessories → Terminal. And type the below code in terminal and
hit enter.

sudo apt-get install apache2

Type your ubuntu 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!’ , then your apache works fine.

Step 2:
Installing PHP

Go Application → Accessories → Terminal. And type the code below in terminal and hit enter.

sudo apt-get install php5 libapache2-mod-php5

Type your ubuntu password if needed.

Type y and hit enter to confirm PHP installation.


After the successful installation restart Apache using the below code

sudo gedit /var/www/phpinfo.php

GroupAID Support Systems Inc. | GroupHUB, 25-32 New Capitol Estates 1, Batasan Hills, Quezon City, Philippines
in the terminal and type your ubuntu password if needed. It will open the phpinfo.php file in
gedit. Type below code in the phpinfo.php file, save and exit it.

<?php phpinfo() ?>

Now open your favorite browser and type http://localhost/phpinfo.php in the address bar and
press enter. If you will see the below page , then your php works fine.

Step 3:
Installing MySql

Go to Application → Accessories → Terminal. And type the below code in terminal and hit
enter.
sudo apt-get install mysql-server

GroupAID Support Systems Inc. | GroupHUB, 25-32 New Capitol Estates 1, Batasan Hills, Quezon City, Philippines
Type your ubuntu 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.

Repeat the password and hit enter

GroupAID Support Systems Inc. | GroupHUB, 25-32 New Capitol Estates 1, Batasan Hills, Quezon City, Philippines
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.

Go to Application → Accessories → Terminal. And type the below code in terminal and hit
enter.
sudo apt-get install phpmyadmin

Type your ubuntu 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

(already selected)
press enter.

GroupAID Support Systems Inc. | GroupHUB, 25-32 New Capitol Estates 1, Batasan Hills, Quezon City, Philippines
Now you will be prompted for phpmyadmin configuration

Select

No

and press enter

Type below command in terminal

sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d

restart your apache server using

sudo /etc/init.d/apache2 restart

Open your browser and type


in the address bar and press enter.

http://localhost/phpmyadmin

GroupAID Support Systems Inc. | GroupHUB, 25-32 New Capitol Estates 1, Batasan Hills, Quezon City, Philippines
Type your mysql root username and paasword to login.

You’re now ready to start building your local website. just put all of your files into

/var/www

GroupAID Support Systems Inc. | GroupHUB, 25-32 New Capitol Estates 1, Batasan Hills, Quezon City, Philippines

You might also like