We're here to assist with any of your needs, don't hestitate to reach out.
The LAMP stack is a popular open-source web development platform that includes Linux as the operating system, Apache as the web server, MySQL as the database management system, and PHP as the scripting language.
Begin by updating the package list:
$ sudo apt update
Then install the Apache web server:
$ sudo apt install apache2
Start and enable Apache to run on system boot:
$ sudo systemctl start apache2
$ sudo systemctl enable apache2
Install the MySQL server package:
$ sudo apt install mysql-server
During the installation, you will be prompted to set a root password. Follow the on-screen instructions to complete the installation.
Install PHP and its required extensions:
$ sudo apt install php libapache2-mod-php php-mysql
After the installation, restart Apache for the changes to take effect:
$ sudo systemctl restart apache2
Create a PHP file to test if the LAMP stack is installed and working correctly:
$ sudo nano /var/www/html/info.php
Add the following code to the file:
Save and close the file.
Open a web browser and type your server's IP address or domain name followed by "/info.php" (e.g., http://your_server_ip/info.php). If everything is set up correctly, you should see the PHP information page.
Congratulations! You've successfully installed the LAMP stack on Ubuntu 20.04. You now have a web development platform with Linux, Apache, MySQL, and PHP ready to use for building and running dynamic websites and applications.
What our customers say about us
Create your free account today.