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
Table of Contents
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: 192.168.56.30
- 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 https://gitlab.com/Danny_Pham/WriteBash.com/raw/master/Install/02-Script_install_LAMP_PHP_7.0_on_Debian_8.sh -O /home/install.sh
Step 2, you move to /home directory and grant permission 700 to this script.
cd /home
chmod 700 install.sh
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.
./install.sh
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.
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
Or you can access the info.php link in the image above for more information on the current version, module, and configuration of PHP.
(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).