Script to install LAMP (PHP 7) on Debian 8

Share this post to your friends !

WriteBash - Today, I will introduce to you about the script to install LAMP (PHP 7) on Debian 8. The script will automatically install all the necessary packages for you. With just a few simple steps, you can have a fast LAMP server stack.

Server resource requirements

Server requirements are as follows:

  • OS: Debian 8.x (in my demo, i use 8.10) 64 bit.
  • RAM: over 1GB memory.
  • HDD: Minimum 1-2 GB of free space.
  • IP: static IP, for example:
  • User: root

Script to install LAMP on Debian 8

About the script: script to install the LAMP stack on Debian 8 automatically.

Version of the package will install:

  • Apache 2.4.10
  • MariaDB 10.0.32
  • PHP 7.0.28-1~dotdeb+8.1

As for the PHP 7 installation package, I use the dotdeb repository, which is not an official repository. You may need to mention whether or not to use it, it all depends on you.

Step 1, you have to download the script that I uploaded to the public repository on Git.

wget -O /home/

Step 2, you move to /home directory and grant permission 700 to this script.

cd /home
chmod 700

Execute the script, noting that the script must be executed by the root user. Script will automatically update, add the necessary repository and install the package.


After about 10-15 minutes, depending on the status of your internet and server resources. When the installation is finished, if you receive a message like the image below, it means that the installation was successful without any errors.

script-to-install-lamp-php-7-on-debian-8-01 Script to install LAMP (PHP 7) on Debian 8
Image finishes installation of LAMP stack.

Check the operation of the LAMP stack

To check whether the software package is fully installed and running, use the commands below.

1. Check service Apache2.

systemctl status apache2

2. Check service MySQL.

systemctl status mysql

3. Check PHP version.

php -v
script-to-install-lamp-php-7-on-debian-8-02 Script to install LAMP (PHP 7) on Debian 8
Access info.php page to view information about PHP.

Or you can access the info.php link in the image above for more information on the current version, module, and configuration of PHP.

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.