Step by step process to host an application in XAMPP webserver on Linux Mint 20 ?

XAMPP is a very well-known web server that is used to host applications that are based on PHP, Perl, MySQL, and Apache.

The best thing about hosting applications on this web server is that you do not need to perform any extra configurations rather you can simply go with the default configurations and start using this webserver straightaway after installing it.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to develop websites locally on XAMPP.

In this context, we shall look into how to work with XAMPP server on Linux Mint 20.


Steps to work with XAMPP Server in Linux Mint 20 ?

To work with XAMPP server in Linux Mint 20, we would like to demonstrate to you the method of creating a simple PHP application and then hosting it on the XAMPP server. 

To achieve this goal, you will have to go through the following four simple steps:


1. Verifying the Installation of XAMPP on Linux Mint 20:

First, you need to verify if the XAMPP server is installed on your Linux Mint 20 system or not. 

i. To do this, you need to launch your terminal start running the XAMPP server using the command stated below:

sudo /opt/lampp/lampp start

If this command is executed successfully and the output shows that the service is already running, then it means that your XAMPP server has started running in the background.


ii. Now you need to launch any browser of your choice preferably Mozilla Firefox in case of Linux Mint 20, and then type the following URL in the address bar of your browser:

www.localhost/

Entering this URL into your browser's search bar will take you to the XAMPP server's dashboard if it has been successfully installed on your Linux Mint 20 system.


2. Navigating to the Document Root Folder:

Now when it is verified that your XAMPP server is installed on your Linux Mint 20 system, it is the right time to navigate to your document root folder where you can create your PHP application that you want to run on your XAMPP server. 

At this point, you can simply stop running your XAMPP server with the "sudo /opt/lampp/lampp stop" command so that you can rerun this server once you have created your application. 

For navigating to the document root folder in Linux Mint 20, you need to execute the following command in your terminal:

cd /opt/lampp/htdocs

Running this command will change the path of your terminal from your Home directory to the /opt/lampp/htdocs directory. 

We have navigated to this directory because the XAMPP server can only read and run those applications that have been stored in this directory.


3. Creating a Simple PHP Application:

i. Now when we have navigated to the document root folder, we can create a simple PHP application by running the command stated below in our terminal:

sudo nano NameOfApplication.php

Here, you need to replace "NameOfApplication" with whatever name you want for your PHP application. 

Also, you can even choose any text editor of your choice for creating this application other than the nano editor.


ii. Once you will run the above-mentioned command, a PHP file will open with the nano editor in which you need to type the script. 

In this script, "<?php" refers to the starting tag of a PHP script whereas “?>” refers to the ending tag of a PHP script. 

Between these two tags, you can write the code of whatever functionality you want for your PHP application. In our case, we only want our application to display a message to the user. 

iii. Therefore, we have typed that message after the "echo" command. Then you need to save your PHP file and then close it.


4. Running the Created PHP Application on XAMPP:

i. By now, our PHP application is ready and we are all set to run it. But before running it, we need to navigate back to our Home directory by executing the "cd" command in our terminal. 

ii. Now we need to start our XAMPP server again by executing the command shown below:

sudo /opt/lampp/lampp start

If the XAMPP server is started successfully, then you will see an Already running message on your terminal.

iii. Now you need to access your browser and in the address bar, you need to type the address of your newly created application after "localhost" i.e. your complete address will be as follows:

www.localhost/MyFirstPHPApplication.php

When you will enter this URL in the address bar of your browser, you will immediately be taken to your newly created PHP application's page.


[Need urgent assistance to host Websites and Application on Xampp on your Linux Server? We are available to help you today. ]


This article will guide you on how to work with #XAMPP in Linux Mint 20. This will help you to easily host your #applications on this server. With this, you can create a simple PHP application, however, you can even choose to create applications with complex functionality that are not essentially written in #PHP but can also be written in Perl or #MySQL.

XAMPP is a powerful and versatile solution for setting up a local web server. It presents a perfect way to create an environment for basic #WordPress coding, experimenting with multisite settings, tweaking #themes, and much more.

To run xampp on Linux:

1. Install gnome-panel to be able to create launcher.

2. Run the below command to execute the Create Launcher Application.

3. The "create launcher" window pops up and select “Application” as the Type.

4. Enter for example "XAMPP starter" as the Name.

5. Enter "sudo /opt/lampp/lampp start" into the Command Box.

To Remove Xampp from Linux (Ubuntu):

i. >sudo /opt/lampp/uninstall.

ii. Alternatively > sudo -i cd /opt/lampp ./uninstall.

iii. > sudo rm -r /opt/lampp.

Related Posts