Install Apache, PHP, MySQL & phpMyAdmin in Ubuntu

Here are step-by-step commands about installing apache, php, mysql, and phpmyadmin on ubuntu.

1) Open Terminal
– Press:

2) Install Apache
– In terminal, type:

– To test if Apache installation, Open browser and type:

– It should show text: It Works!

3) Install PHP
– In terminal, type:

4) Install MySQL
– In terminal, type:

– You will be asked for mysql root password. Keep your desired password and press ENTER (or press TAB to select OK and presee ENTER)

5) Install phpMyAdmin
– In terminal, type:

– You will be asked for Web server configuration. Press SPACE key to select ‘apache2’ and press TAB to select ‘Ok’ and then press ENTER.

– Then, you will be asked for phpMyAdmin Configuration. Press TAB to select ‘No’.
– Type the following in terminal:

6) Restart Apache
Type either of the following in terminal:


7) Test PHP and phpMyAdmin
Open browser and type:

– A login screen should appear.

– Login with your database username and password. The username should be ‘root’ and password is the one that you entered while installing MySQL in step #4 above.

Your should put your PHP files in /var/www/ directory.

Hope it helps. Thanks.

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *