How to install LAMP (Linux Apache MySQL PHP) on Xubuntu 14.04

This tutorial is going to show you How to install LAMP (Linux Apache MySQL PHP) on Xubuntu 14.04. LAMP stands for Linux Apache MySQL and PHP. With LAMP we can turn our Xubuntu 14.04 into a powerful web server with PHP and MySQL support. Its very easy to install LAMP on Xubuntu 14.04. With a single command we can get this LAMP and all dependencies installed.

To install LAMP (Linux Apache MySQL PHP) on Xubuntu 14.04, open Terminal and type this command

[codesyntax lang=”bash” lines=”no”]

sudo apt-get install lamp-server^

[/codesyntax]

Dont forget the ^ at the end of the command above.

[codesyntax lang=”bash” lines=”no”]

dhani@dhani-xubuntu:~$ sudo apt-get install lamp-server^
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'mysql-server-core-5.5' for task 'lamp-server'
Note, selecting 'mysql-server-5.5' for task 'lamp-server'
Note, selecting 'libaio1' for task 'lamp-server'
Note, selecting 'mysql-client-core-5.5' for task 'lamp-server'
Note, selecting 'apache2-mpm-prefork' for task 'lamp-server'
Note, selecting 'libaprutil1' for task 'lamp-server'
Note, selecting 'libapache2-mod-php5' for task 'lamp-server'
Note, selecting 'php5-mysql' for task 'lamp-server'
Note, selecting 'php5-common' for task 'lamp-server'
Note, selecting 'libaprutil1-dbd-sqlite3' for task 'lamp-server'
Note, selecting 'php5-readline' for task 'lamp-server'
Note, selecting 'ssl-cert' for task 'lamp-server'
Note, selecting 'mysql-client-5.5' for task 'lamp-server'
Note, selecting 'libhtml-template-perl' for task 'lamp-server'
Note, selecting 'libterm-readkey-perl' for task 'lamp-server'
Note, selecting 'libaprutil1-ldap' for task 'lamp-server'
Note, selecting 'mysql-common' for task 'lamp-server'
Note, selecting 'php5-cli' for task 'lamp-server'
Note, selecting 'libmysqlclient18' for task 'lamp-server'
Note, selecting 'apache2-data' for task 'lamp-server'
Note, selecting 'php5-json' for task 'lamp-server'
Note, selecting 'libapr1' for task 'lamp-server'
Note, selecting 'apache2' for task 'lamp-server'
Note, selecting 'mysql-server' for task 'lamp-server'
Note, selecting 'apache2-bin' for task 'lamp-server'
Note, selecting 'libwrap0' for task 'lamp-server'
Note, selecting 'libdbd-mysql-perl' for task 'lamp-server'
Note, selecting 'tcpd' for task 'lamp-server'
Note, selecting 'libdbi-perl' for task 'lamp-server'
libwrap0 is already the newest version.
ssl-cert is already the newest version.
tcpd is already the newest version.
libmysqlclient18 is already the newest version.
libmysqlclient18 set to manually installed.
mysql-common is already the newest version.
mysql-common set to manually installed.
Suggested packages:
  apache2-doc apache2-suexec-pristine apache2-suexec-custom apache2-utils php-pear libmldbm-perl libnet-daemon-perl libplrpc-perl libsql-statement-perl libipc-sharedcache-perl tinyca mailx
  php5-user-cache
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-mpm-prefork libaio1 libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libdbd-mysql-perl libdbi-perl
  libhtml-template-perl libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-server mysql-server-5.5 mysql-server-core-5.5 php5-cli php5-common php5-json php5-mysql
  php5-readline
0 upgraded, 24 newly installed, 0 to remove and 139 not upgraded.
Need to get 14,6 MB of archives.
After this operation, 119 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

[/codesyntax]

Type Y and press Enter to confirm the installation.

During installation, you will be asked for MySQL root password. Once finished, start the Apache web server

[codesyntax lang=”bash”]

sudo service apache2 start

[/codesyntax]

Now check if Apache was installed correctly. Open web browser and type http://localhost. You should see the following page displayed on your web browser.

install lamp server on xubuntu 14.04 1

Next check if PHP5 was correctly installed:

[codesyntax lang=”bash”]

sudo nano /var/www/html/info.php

[/codesyntax]

Now paste the following lines to the info.php

[codesyntax lang=”php” lines=”normal”]

<?php
phpinfo();
?>

[/codesyntax]

Next, open web browser again and type: http://localhost/php.info. You should see something like this

install lamp server on xubuntu 14.04 2

Now all done. LAMP Server is installed on Xubuntu 14.04.

Admin

6 Comments

  1. Another better way is to install each package seperately (to be sure to get in the future the update of each packet at the right time) with the command:
    sudo apt-get install apache2 php5 mysql-server libapache2-mod-php5 php5-mysql

    And width PhpMyAdmin add: phpmyadmin

  2. Not Found

    The requested URL /php.info was not found on this server.
    Apache/2.4.7 (Ubuntu) Server at localhost Port 80

    ——–
    it is my error..
    what i can do ?

  3. Am using Deepin linux,
    after installation i tried sudo nano /var/www/html/info.php, then i got
    sudo: nano/var/www/html/info.php: command not found

    how to correct this

    • sudo nano /var/www/html/info.php
      please make sure you put space after sudo and after nano. This command will create a blank file called info.php

Leave a Reply

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