To install LAMP (Linux, Apache, MySQL, PHP) on Debian 10 (Buster), you can use the following steps:
- Install Apache web server:
sudo apt-get update
sudo apt-get install apache2 -y
- Install MySQL server:
sudo apt-get install mysql-server -y
- Install PHP and necessary modules:
sudo apt-get install php php-mysql libapache2-mod-php -y
- After installation, start Apache and MySQL services:
sudo systemctl start apache2
sudo systemctl start mysql
- To start the Apache and MySQL services on boot:
sudo systemctl enable apache2
sudo systemctl enable mysql
- To test your LAMP installation, create a new file in
/var/www/html/
directory with the nameinfo.php
and add the following line in it:
phpinfo();
- Access the file in a web browser by visiting
http://your-ip-address/info.php
. You should see the PHP information page, indicating that LAMP is correctly installed.
Note: You should secure your mysql installation with mysql_secure_installation command, set a root password and remove test user and test databases.