How to install XAMPP on Linux?

XAMPP

Today I will share with you how we can install XAMPP, which we will use to set up our own web server on our computer, whether to perform internal tests or launch our computer as such.

If you are not familiar with XAMPP , let me tell you that it is a package of free software applications that work together to act as a web server.

XAMPP consists of the MariaDB database management system , the Apache web server , and interpreters for the PHP and Perl scripting languages.

Personally, I think this is a simple way to get all this package, which, unlike installing each component separately, is an excellent option for both advanced users and newbies.

Installing XAMPP on Linux

The first step we need to take to have XAMPP installed on our system is to go to its official website and download the installer they offer for Linux; the link is this one.

Next, we will open a terminal and give execution permissions to the file we downloaded , we do it in the following way.

Note, at the moment the XAMPP version is 7.2.4-0 so the nomenclature may be different from the one you download, you just have to correct the command by naming the file that you downloaded.

sudo su

chmod + xampp-linux-x64-7.2.4-0-installer.run

./xampp-linux-x64-7.2.4-0-installer.run

When you run the installer, an installation wizard will open where you should click next and accept everything if you require a regular installation.

If you require a custom installation, you will be the one to change the options offered by the installer to your convenience and need.

install-xampp-linux

At the end of the installer you will already have XAMPP installed on your system.

How to use XAMPP on Linux?

In order to run all the services that make up XAMPP, you can do it by running its manager, with which we can start or stop the service daemons.

You just have to look for his manager in your application menu.

Alternatively, you can run these services from the terminal; to do so, simply execute the following commands:

To start XAMPP

sudo /opt/lampp/lampp start

To stop XAMPP

sudo /opt/lampp/lampp stop

To restart XAMPP

sudo /opt/lampp/lampp restart

Where is the XAMPP folder?

If you don't know where to place your projects for testing or simply to host your website so it can be viewed in a browser, the path is as follows :

/ opt / lampp / htdocs

How to see my web pages created in XAMPP?

One of the most common errors is that they do not place the files inside the indicated folder ; the path was given in the previous point. Another error that often happens to novices is that they do not have the Apache or MariaDB daemon started.

If you are only creating in HTML, CSS JavaScript will have no major problem since browsers interpret these languages ​​without major problem.

But if it's PHP, that's when the problem arises; you just need to make sure that the Apache and MariaDB services are running without problems.

How to view my XAMPP tests in the browser?

If you have already placed your test project inside the XAMPP folder and want to view it in the browser, just type localhost or 127.0.0.1 in the address bar.

For example:

If you put the file "test.php" in / opt / lampp / htdocs /, in the address bar you write localhost / test.php.

Example 2:

If your project is in /opt/lampp/htdocs/web/index.php, in the address bar you type localhost / web / index.php.

Where is the php.ini file in XAMPP?

This configuration file is often very useful because the configurations that PHP usually comes with are not enough.

To adjust it to our needs, we only need to edit the values ​​in the php.ini file located in the following path :

/opt/lammp/etc/php.ini

And with this, I believe that they are the most basic concepts of using XAMPP that more than one novice will use.


Add as preferred source in Google