Install Linux, Apache, MySQL, PHP (LAMP) stack

How to install Linux, Apache, MySQL, PHP (LAMP) stack
How to install Linux, Apache, MySQL, PHP (LAMP) stack

PHP (LAMP) stack,install Linux In this academic we can cover the steps had to deploy the LAMP stack on your CentOS 6.4, Debian or Ubuntu platform. LAMP is a mixture of running device and open-supply software for you to help you installation a running web hosting environment. The acronym LAMP is derived from the primary letters of Linux, Apache, MySQL and PHP.

PHP (LAMP) stack,install Linux Requirements:

PHP (LAMP) stack,CentOS 6.Four, Debian or Ubuntu mounted in your laptop/server
SSH access (Command line get admission to to the server)
root privileges
Basic competencies for running on a Linux environment

PHP (LAMP) stack,install Linux Install Apache

PHP (LAMP) stack,We will begin with the installation of the Apache net server that is the most popular HTTP server in recent times. In order to put in the Apache service we are able to use the default bundle manager blanketed inside the corresponding Linux distribution:

CentOS 6.4

yum makecache
yum install httpd
service httpd start

sudo apt-get update
sudo apt-get install apache2

You might be prompted to simply accept the set up and addition package dependencies may be displayed.

install Linux Test the functionality of the Apache service

Once the installation is completed you can test the Apache service using your browser:




where X.X.X.X is your server’s IP address, i.e.

You should be able to see the default Apache page inside your browser.

An easy way to find your server’s IP address is to execute the following command:

ip addr show eth0|grep inet|awk '{print $2}'|cut -d / -f1

PHP (LAMP) stack,Install MySQL

MySQL is one of the maximum famous database management structures. The set up of the software program can be completed with the subsequent commands:

CentOS 6.4

123yum makecacheyum install mysql-serverservice mysqld start


12sudo apt-get updatesudo apt-get install mysql-client mysql-server

During the installation you might be brought on to set root password for the MySQL provider. If now not, you may set the basis password after final touch of the set up the use of the subsequent command:

sudo mysql_secure_installation

PHP (LAMP) stack,Test the functionality of the MySQL service

You can take a look at if everything went nicely throughout the set up using the default MySQL client:

mysql -p -u root

You will be brought on to go into the foundation password.

PHP (LAMP) stack,Install PHP

PHP is one of the most used open-source scripting languages desired by the internet developers. The software set up may be finished with the subsequent instructions:

CentOS 6.4

123yum makecacheyum install php php-mysqlservice httpd restart


123sudo apt-get updatesudo apt-get install php5 libapache2-mod-php5 php5-mysqlsudo /etc/init.d/apache2 restart

PHP (LAMP) stack,Test the functionality of the PHP parser

Once finished you can check the functionality of the carrier by means of growing a check PHP data report inside the Apache web root folder

nano test.php

Containing the subsequent lines:

1<?php phpinfo(); ?>

Save the file and open it using your browser:


Default PHP information page should be displayed on your end.

Start Up Apache/MySQL automatically on server boot

In order for the services to start automatically upon server boot up you can execute the following commands:

CentOS 6.4

12chkconfig httpd onchkconfig mysqld on


12sudo update-rc.d apache2 defaultssudo update-rc.d mysql defaults

At the end you should have a working hosting environment which includes the Apache, MySQL and PHP software.