How to install XAMPP on Ubuntu Linux
This tutorial describes how to install the XAMPP on the Ubuntu Linux. Learn what the XAMPP is and how to install and configure it in the Ubuntu Linux with the practical example.
Brief intro of the XAMPP
XAMPP is a standalone application that provides web server environment for developing and testing the PHP based web applications. It mainly contains four elements; PHP, Perl, Apache and MariaDB.
PHP and Perl are the programing languages. These are used to create dynamic websites and other web based applications.
A browser that is used to access the websites does not understand these languages. For this reason, if a web page is created with these languages, then it must be converted into a language that the browser understands.
This conversion is done by the Apache server. Apache web server processes and converts all dynamic contents of the webpage before sending it to the browser.
Usually data is stored separately in websites. To store and process the data, database server is used. MariaDB is the database server.
Why use XAMPP in Linux
Almost all Linux flavors, including Ubuntu, not only support these elements, but also incorporate these elements into the default installation disc. You may wonder why one should bother about the XAMPP when Linux already has all these elements.
The answer is simplicity and pre-configuration. Linux offers these elements as they are. It means; to use these elements all required settings and services need to configure manually.
Configuring and running Apache server is a complex task. Only an experienced network administrator can do this. XAMPP makes this task easier. It contains the simplified and localized versions of the Apache web server and MariaDB.
Which one should be chosen is depend on the situation and usage. For example, a web developer who does not have any networking experience can
use XAMPP for developing and testing the web applications. But a web hosting company cannot use it to provide the hosting services.
Installing XAMPP in Ubuntu
Connect system with the Internet and download the latest version of the XAMPP from the following web page.
Open the folder which contains the downloaded XAMPP installer file.
Right click in the empty space of the opened window. From right click context menu, click the option Open in Terminal.
In opened terminal, execute the following commands.
$ls $chmod 755 xampp-linux-[version_number]-installer.run $ls -l
First command verifies that XAMPP installer file exists in the current folder.
Second command makes the installer executable. By default, it is not executable.
In order to install the XAMPP from this file, we have to make it executable. When executing this command, replace the
text [version_number] with the version number of the XAMPP.
Third command confirms that installer file has become executable.
Following figure shows above commands with the output.
Once installer file becomes executable, run the following command to start the installation process.
Authenticate access with the sudo password.
Upon successful authentication, installer script starts the installation process in graphical wizard.
On the Welcome screen, click the Next button.
XAMPP offers additional components with the default installation.
Unless you have very low disk space, there is no need to exclude these additional components from the installation.
Keep the default selection and click Next button.
In next screen, wizard displays the location where it will install the XAMPP.
Click Next button to continue the installation.
In next screen, wizard gives us a choice to install the Bitnami application along with XAMPP.
Bitnami is the sponsored application which can install open source CMS software (such as WordPress, Joomla, Drupal,etc.) in XAMPP.
This add-on feature is optional. If require, all these CMS applications can be installed manually.
There is no need to install this application with the standard XAMPP installation. Remove the selection and click Next button.
That’s all information the wizard needs before starting the installation process.
Click Next button to start the installation process.
Installation process may take several seconds (even few minutes).
Once installation process is finished, wizard will display the confirmation message.
On the last screen, wizard provides an option to launch the XAMPP just after closing the wizard. By default this option is selected.
You can keep this option selected or can remove it. Click Finish button to close the wizard.
Once XAMPP is installed successfully, it can be started, stopped and restarted with the following commands.
$sudo /opt/lamp/lamp start $sudo /opt/lamp/lamp stop $sudo /opt/lamp/lamp restart
When starting the XAMPP, you may get the following errors messages.
XAMPP: Starting Apache… /opt/lampp/share/xampp/xampplib: line 22: netstat: command not found ok. XAMPP: Starting MySQL… /opt/lampp/share/xampp/xampplib: line 22: netstat: command not found ok. XAMPP: Starting ProFTPD… /opt/lampp/share/xampp/xampplib: line 22: netstat: command not found ok.
Actually these are not error messages; these are the notification messages which indicate that the command netstat is not installed.
The command netstat is the part of the net-tools package. To install this package, use the following command.
$sudo apt install net-tools
Once this package is installed, you can manage the XAMPP without these notification messages.
Verifying XAMPP installation
To verify the XAMPP installation, open the Firefox and access the following URL.
If XAMPP has successfully installed, then the following webpage will be displayed.
That’s all for this tutorial. If you like this tutorial, please don’t forget to share it through your favorite social network.