Script to install LAMP (PHP 7) on Debian 9

by Daniel Pham
Published: Updated:

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 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 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 to install LAMP (PHP 7) 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

(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

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