Script to install LAMP (PHP 7) on Ubuntu 16

by Daniel Pham
Published: Updated:

Today, I will show you how to use the script to install LAMP (PHP 7) on Ubuntu 16. Installing LAMP stack on Ubuntu is pretty much used, this script will save you time. Installed quickly and successfully tested.

Server resource requirements

Server requirements are as follows:

  • OS: Ubuntu 16.04.4 LTS 64bit.
  • RAM: over 1GB memory.
  • HDD: Minimum 1-2 GB of free space.
  • IP: static IP, for example: 192.168.56.20
  • User: root

Script to install LAMP on Ubuntu 16

Script will install the package in the LAMP stack as follows:

  • Apache 2.4.18
  • MariaDB 10.0.34
  • PHP 7.0.25-0ubuntu0.16.04.1

The packages installed in this script are loaded from the official Ubuntu repository, without using any external repositories. You install the LAMP stack according to the following steps.

Script to install LAMP (PHP 7) on Ubuntu 16
Using script to install LAMP stack (PHP 7) on Ubuntu 16.

First, you download the script.

wget https://gitlab.com/Danny_Pham/WriteBash.com/raw/master/Install/04-Script_install_LAMP_PHP_7.0_on_Ubuntu_16.sh -O /home/install.sh

Next, you grant permission for the script.

chmod 700 /home/install.sh

And finally, execute the script using the following command.

bash /home/install.sh

Script will install in about 15 minutes, you can stand up to take a cup of coffee and come back.

Check the operation of LAMP

You can now open the browser and go to the page info.php for informations about PHP.

Script to install LAMP (PHP 7) on Ubuntu 16
Display PHP informations.

Next, type the following commands to check the status of the services.

To check Apache service, you type the below command.

systemctl status apache2

Check MariaDB service, you type the below command.

systemctl status mysql

To check the version of the installed software, you have the following commands.

Check Apache version.

apache2 -v

To check MariaDB version.

mysql --version

And check PHP version.

php -v

So you have successfully installed LAMP stack on Ubuntu 16 quickly, now you can set up virtualhost for your website.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.