How To Install LAMP setup in Ubuntu 15.10

To Install LAMP setup in Ubuntu 15.10

In this tutorial we are going to install LAMP setup in Ubuntu 15.10. LAMP stands for Linux Apache Mariadb or Mysql and Php.


To Install the apache webserver

Run the following command to install Apache by using the following command.

root@user1-linuhelp:/home/user1# apt-get install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.
.
Setting up apache2 (2.4.12-2ubuntu2.1) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...

After the installation is completed, check the status of apache web-server

root@user1-linuhelp:/home/user1# systemctl status apache2


Open the web-browser and enter http://< IP_address>

To install of Mariadb

Utilise the following command to install Mariadb.

root@user1-linuhelp:~# apt-get install mariadb-server mariadb-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.



.
.
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ..

Configure the Mariadb setup.

root@user1-linuhelp:~# mysql_secure_installation



Open the Mariadb prompt.

root@user1-linuhelp:~# mysql  -u root &ndash p

To install of Php

Run the following command to install Php.

root@user1-linuhelp:~# apt-get install php5 libapache2-mod-php5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.
.
php5_invoke: Enable module readline for apache2 SAPI
php5_invoke: Enable module readline for cli SAPI
Processing triggers for libapache2-mod-php5 (5.6.11+dfsg-1ubuntu3.4) ...

Create a new file called info.php in the apache' s default root directory.

root@user1-linuhelp:~# cd /var/www/html
root@user1-linuhelp : /var/www/html:~#  nano info.php

And add the following lines into it.

< ?php
phpinfo()
?> 

Open the browser and navigate to http://< IP_address> /info.php

Now the LAMP server is installed successfully in Ubuntu 15.10.

FAQ
Q
State the main difference between mysql_fetch_array and mysql_fetch_object?
A
Mysql_fetch_array will fetch all the matching records, whereas mysql_fetch_object will only fetch the first record that matches the query.
Q
What is the Purpose of using the LAMP setup?
A
LAMP is a server configuration for various web applications. It helps in running servers and dynamic web sites. It is a web development platform that uses Linux operating system, Apache web s
Q
How you will find the number of elements present in an array ?
A
To find the no. of elements in an array, you can either use count() or sizeof() function
Ex: count($array) or sizeof($array).
Q
How Can you increase the maximum upload size in PHP ?
A
Yes, we can use the upload_max_filesize variable to change the maximum size of a file you can upload.
Q
How you will define a Session ?
A
A Session is a method to store some data to be used across multiple pages. In technical terms it is a logical object that is stored in the server to help you store data and can be accessed ac