How to set up a LAMP environment with XAMPP on Ubuntu Linux

This guide shows you how to set up a LAMP server (Linux, Apache, MySQL and PHP) for developing PHP-based web applications on Ubuntu Linux with XAMPP.

You can use the XAMPP stack to develop PHP applications powered by frameworks like WordPress, Joomla, Drupal, PrestaShop, etc.

What is XAMPP?

XAMPP is one of the most popular LAMP stacks for building a PHP development environment. It’s open source and available on all major operating systems, including Windows, Linux, and macOS. The core components that work together to create XAMPP include Apache, MySQL, PHP, and Perl.

The XAMPP server is ideal for software development or prototyping as it is relatively easy to set up and does not require a lot of configuration. Note, however, that XAMPP is not recommended for use as a production server as it compromises some security issues to make setting up your development environment easier. For example:

  • Anyone can easily access the MariaDB daemon over the network.

  • The default database administrator (root) does not have a password.

Download XAMPP for Linux

To get started, you should download the XAMPP Debian package for Ubuntu Linux as described below.

First go to your Downloads directory with the cd command.

cd ~/Downloads

Run the following command to download XAMPP with wget, a command line tool for downloading packages from the Internet.

wget https://www.apachefriends.org/xampp-files/8.0.8/xampp-linux-x64-8.0.8-0-installer.run

Note: You can replace the XAMPP version in the command above with the version of your choice if you want.

Since your current working directory is the / Downloads Folder wget will automatically save the installation program of the XAMPP application in this directory.

How to install XAMPP on Ubuntu

Before you can install the XAMPP application, you must change the permissions of the installer to make it executable with the chmod command.

sudo chmod 755 xampp-linux-x64-8.0.8-0-installer.run

If you run the XAMPP installer with the ls -l Command, you will get output similar to the following. As you can see, the installer now has “Run” permissions.

Listing of the xampp installation program under Linux

Issue the following command to start the XAMPP installer:

sudo ./xampp-linux-x64-8.0.8-0-installer.run

The start screen of the XAMPP installer should look similar to the following:

Screen for the initial installation of the xampp server

Click on that Next and follow the installation instructions of the wizard.

Click on that Finished Button to complete the installation.

xampp last installation page

As soon as the installation is complete, the system saves the XAMPP files in / opt / lampp Directory on your system. The websites or projects are in the / opt / lampp / htdocs Directory.

To start the XAMPP services like Apache, MySQL and ProFTPD just run the following command:

sudo /opt/lampp/lampp start

Output of the start of xampp from the terminal

You can check the status of the XAMPP services by typing:

sudo /opt/lampp/lampp status

Also note that XAMPP comes with a graphical tool that makes it easy to manage your services. You can start the XAMPP GUI tool with the following commands:

cd /opt/lampp
sudo ./manager-linux-x64.run

The following XAMPP window will open.

xampp GUI menu installer

Check if everything works

If you can start the services without any problems, everything is likely working as expected.

To check that the Apache server is serving your web pages as expected, type http: // localhost in your web browser. The browser displays a page similar to the following. For your information, the Apache server runs on port 80 by default.

xampp standard website

You can also access the MySQL database that comes with XAMPP by typing: http: // localhost / phpmyadmin Url in your browser.

Learn more: With this course you will become an expert in web development and MySQL

Setting up a LAMP server in WSL

This guide showed you how to set up a XAMPP server that will be used when developing your PHP-based applications. For security reasons, you should never use XAMPP for production purposes.

For developers working on the Windows subsystem for Linux, you can also set up a LAMP server on WSL if necessary.


Code editor on a laptop
How to set up a LAMP test environment on the WSL

Do you want to start web development on the Windows Subsystem for Linux? Start by setting up a LAMP test environment.

Continue reading


About the author

.


Source link

About Willie Ash

Check Also

Lumen Black Lotus Labs notes that Linux executables have been deployed as stealth Windows loaders

DENVER, September 16, 2021 / PRNewswire / – Black Lotus Labs, the threat intelligence arm …

Leave a Reply

Your email address will not be published. Required fields are marked *