日期:2014-05-17  浏览次数:20836 次

ubuntu下安装LAMP How-to Install LAMP Server[Apache, MySQL, Php]

Linux LAMP servers are also popular, flexible and reliable as WAMP server. The installation of both servers are very easy and differ from each other. LAMP means L inux A pache M ysql P hp, and WAMP is for Windows. WAMP server installs automatically(installer),you are able to use server without touching setting files. While LAMP server installs with commands. Here, I am going to show how to install LAMP server through Terminal on Ubuntu.

?

LAMP Installation:

To install LAMP server, open up a Terminal window(Ctrl+Alt+t ), and type the following commands.

All commands have written in italic words and remember Terminal commands are case sensitive!!

?

To install Apache:

sudo apt-get install apache2
?

Now to confirm the installation of Apache2 open http://127.0.0.1 in your web browser, you will see It Works! default page of Apache.

?


To install Mysql:

sudo apt-get install mysql-server
?

At the installation you be will asked to provide a root password for Mysql.


To install php:

sudo apt-get install php5 libapache2-mod-php5
?

After this installation restart Apache [sudo /etc/init.d/apache2 restart ] don’t write brackets.

Now make a phpinfo.php file and save that in /var/www to do this use [sudo gedit /var/www/phpinfo.php ] write a code in this file

?

<?php
phpinfo();
?>
?

Now open http://127.0.0.1/phpinfo.php

?


To install phpmyadmin:

sudo apt-get install phpmyadmin
?

?

Two option window will open in installation one for web server reconfigure automatically[ select apache2] and second for configure database for phpmyadmin with dbconfig-common [ select No] .

?