Script to install LAMP (PHP 7) on Debian 9

Share this post to your friends !

WriteBash - In this article, I will guide you to use the script to install the LAMP on Debian 9. I have successfully tested this script on Debian 9.3 64bit. Just a few lines of code you can install the LAMP stack quickly.

Server resource requirements

Server requirements are as follows:

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

Script to install LAMP on Debian 9

This script will automatically install the necessary software of the LAMP stack, the software version as follows:

  • Apache 2.4.25
  • MariaDB 10.1.26
  • PHP 7.0.27-0+deb9u1

Steps to use the script to install the LAMP stack are as follows.

script-install-lamp-on-debian-9-01 Script to install LAMP (PHP 7) on Debian 9
Download the script to install LAMP stack on Debian 9.

Step 1, you download the script from my repository.

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

Step 2, you have to grant permission 700 for this script.

chmod 700 /home/install.sh

And the last step, 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.

bash /home/install.sh

Depending on the speed of your internet connection, you may have to wait 10 to 15 minutes to complete the installation process.

Read moreScript to install LAMP on Debian 8.

script-install-lamp-on-debian-9-02 Script to install LAMP (PHP 7) on Debian 9
Finish the installation process.

Check the LAMP stack after installation

Now, you can open the browser up, visit the page http://your_server_ip/info.php. The result like image below.

script-install-lamp-on-debian-9-03 Script to install LAMP (PHP 7) on Debian 9
Check PHP infomations after install LAMP stack on Debian 9.

To check Apache service, you type the below command.

systemctl status apache2

To check MariaDB service, you type the below command.

systemctl status mysql

And to see PHP version, please type command.

php -v
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.