How to install and configure Apache, PHP, MySql and phpMyadmin on Linux




Step 1:
Installing apache:
Type the below code in terminal and hit enter.
sudo apt-get install apache2
Type your linux password and press enter.
Type y and hit enter to confirm apache installation.
Do you want to continue [y/n]? y

After the successful installation , open your favorite browser and type
http://localhost/
If you will see ‘It works!’ , then your apache works.

Step 2:

Installing PHP
Type the below code in terminal and hit enter.

sudo apt-get install php5 libapache2-mod-php5

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

Do you want to continue [y/n]? y

After the installation restart Apache using the below code:

sudo /etc/init.d/apache2 restart

Test PHP installation:
sudo gedit /var/www/phpinfo.php

in the terminal type your linux 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
echo"Hello World"

?>

Now open your browser and type:
http://localhost/phpinfo.php
Now your php works fine.

Step 3:
Installing MySql

Type the below code in terminal and hit enter.
sudo apt-get install mysql-server
Type your password if needed.
Type y and hit enter to confirm MySql installation.

Do you want to continue [y/n]? y

During the installation you will be prompted for a password. Choose secure and strong password and hit enter.
 
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 Menu->Terminal. And type the below code in terminal and hit enter.
sudo apt-get install phpmyadmin
Type your password if needed.
Type y and hit enter to confirm phpMyadmin installation.

Do you want to continue [y/n]? y

During the installation you will be prompted for a webserver configuration. Select
apache2
(already selected) press enter.
Now you will be promped for phpmyadmin configuration Select
Ok
press enter.
Then select Yes and hit enter.

Enter the password of database’s admin user and press the down arrow key to point ok and hit the enter key.

provide a MySQL application password for phpmyadmin and press the down arrow key to point ok and

hit the enter key.
repeat your password and click ok

restart your apache server using
sudo /etc/init.d/apache2 restart
Type your linux mint password if needed. And restart your pc.
Open your browser and type
http://localhost/phpmyadmin/
Type your mysql root username and password to login.

You’re now ready to start building your website in localhost. Put all of your files into
/var/www
Method :2 Installing phpmyadmin:
Go to Menu->Terminal. And type the below code in terminal and hit enter.
sudo apt-get install phpmyadmin
Type your 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.
Now you will be promped for phpmyadmin configuration Select
Ok
press enter.
select No and hit 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:
http://localhost/phpmyadmin/
Type your mysql root username and password to login.



Now you have successfully completed all installation.

Related Post:

How to Use Ubuntu 11.10

 


Comments

  1. The acronym stands for Windows Apache MySQL PHP server. WAMP is extremely simple to install and a good platform for either evaluating PHP + MYSQL applications or operating the same for up to a few hundred users. So you can easily connect database on php MySql.
    ______________________
    Famtex.pl

    ReplyDelete

Post a Comment