Script to install LAMP (PHP 7) on Ubuntu 16

Share this post to your friends !

WriteBash - 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:
  • 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-01 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 -O /home/

Next, you grant permission for the script.

chmod 700 /home/

And finally, execute the script using the following command.

bash /home/

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-02 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.

If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.

Share this post to your friends !
If you appreciate what we share in this blog, you can support us by:
  1. Stay connected to: Facebook | Twitter | Google Plus | YouTube
  2. Subscribe email to recieve new posts from us: Sign up now.
  3. Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
  4. Become a Supporter - Make a contribution via PayPal.
  5. Support us by purchasing Ribbon Lite Child theme being using on this website.

We are thankful for your support.

single post bottom banner
«« »»

Got something to say? Join the discussion

Please keep in mind that all comments are subject to our Comment Policy. Your email address will not be published.
This site uses Akismet to reduce spam. Learn how your comment data is processed.