×


Install XAMPP on CentOS 8 - Step by Step process to do this ?

XAMPP is short for cross-platform(X), Apache(A) server, MariaDB(M), PHP(P) and Perl(P). It enables a user to turn his system into a fully-featured web server. 

XAMPP is available for the major OS including Linux, Windows, and MacOS. 

It allows building a website offline to test it on the local machine before uploading it to a remote server.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform CentOS related Software Installation tasks.

In this context, we shall look into how to install XAMPP on CentOS.

Previously, we have dealt with the installation of XAMPP on Linux Mint .


How to install XAMPP on CentOS ?

To install any program on a Linux system, you must be a root user or have sudo privileges.

For the installation on XAMPP, follow the steps given below.


1. Install Net-tools

XAMPP server requires netstat to be installed on your system. Netstat is a part of the net-tools package. Therefore, you will have to install the net-tools package on your CentOS system. 

Execute this command in Terminal to do so:

$ sudo yum install net-tools

Enter the password for sudo, after which the net-tools will be installed on your system.


2. Download the Installer Package

Now you will have to download the XAMPP installer package for Linux OS. Visit the following website and download the latest version of XAMPP for Linux:

https://www.apachefriends.org/download.html

Alternatively, you can use execute the below command in Terminal to download XAMPP for Linux:

$ wget https://www.apachefriends.org/xampp-files/8.0.0/xampp-linux-x64-8.0.0-2-installer.run

Once the XAMPP installer is downloaded, move on to the next step.


3. Make the Installer Package Executable

Now using the cd command, move inside the directory which contains the XAMPP installer file you have downloaded in the previous step. 

Then execute the below command to make the installer file executable:

$ sudo chmod 755 xampp-linux-x64-8.0.0-2-installer.run


4. Run the Installer

i. Then in order to install XAMPP, run the installer as follows:

$ sudo ./xampp-linux-x64-8.0.0-2-installer.run

ii. After running the above command, the following setup wizard will launch. 

iii. Click Next to continue.

iv. Next in the following screen, you will be asked to select the components to install. 

v. Leave the default selection as it is and hit Next.

vi. Now for the subsequent windows, keep on clicking Next until you see "Welcome to XAMPP" window. 

Wait until the installation of selected components is done. 

vii. Then hit Next.

Now a window will inform you about the completion of the XAMPP installation on your system. 

viii. Click Finish to close the wizard. 

If you do not want to start XAMPP now, you can also uncheck the Launch XAMPP checkbox.


5. Start and Verify XAMPP Installation

To start XAMPP from the Terminal, execute the below command:

$ sudo /opt/lampp/lampp start

You will see an output which indicates that XAMPP is started and already running. 

Note that each time you restart your machine; you will need to manually start XAMPP.


After running the above command, you may receive the following error like I had:

httpd: Syntax error on line 522 of /opt/lampp/etc/httpd.conf: Syntax error on line 10 of /opt/lampp/etc/extra/httpd-xampp.conf: Cannot load modules/libphp7.so into server: libnsl.so.1: cannot open shared object file: No such file or directory

To resolve this error, install libnsl library using the below command in Terminal:

$ sudo dnf install libnsl

Now again start XAMPP as described above.

To verify the installation of XAMPP, access the following address in your web browser:

http://localhost

Now, you will see that XAMPP has been successfully installed and running on your system.


Then access the following address to verify if phpmyadmin has been installed:

http://localhost/phpmyadmin

You will see the phpmyadmin page on your browser which indicates the phpmyadmin has also been successfully installed and running on the system.


If you need to stop XAMPP, execute the below command in Terminal:

$ sudo /opt/lampp/lampp stop


How to Uninstall XAMPP from CentOS system ?

In case you no longer need XAMPP, you can easily remove it from your system.

i. First, move inside the /opt/lampp directory where the XAMPP is installed:

$ cd /opt/lampp

ii. Then run the uninstaller file as follows:

$ sudo ./uninstall

iii. Then you will be asked if you want to uninstall XAMPP and its modules.

Click Yes, after which it will start uninstalling XAMPP from the system. 

iv. Once it is uninstalled, you will see a dialog notifying you with the uninstallation completed message. Click OK to close the dialog.

v. If you also want to remove the XAMPP directory along with its files, execute the below command in Terminal:

$ sudo rm -r /opt/lamp


[Need urgent assistance in installing missing packages on CentOS system? We are available to help you today. ]


Conclusion

This article covers how to install XAMPP on your CentOS system. XAMPP is an easy to install and use Apache distribution packaged with MariaDB, PHP, and Perl.

XAMPP was first developed by a project team called Apache Friends. As an open-source Apache distribution of a PHP development environment, it consists of cross-platform software (X): Apache (A), MariaDB (M), PHP (P) and Perl (P). 


To install XAMPP on CentOS 8 Linux system:

1. Update system

Ensure your CentOS system is updated.

$ sudo dnf -y update
$ sudo dnf -y install libnsl

2. Download XAMPP on CentOS 8

Install wget on CentOS 8:

$ sudo dnf -y install wget

Download XAMPP installer. Choose the installer matching the PHP version you want to have.

### PHP 8.0 ###

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

### PHP 7.4 ###

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

### PHP 7.3 ###

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

3. The binary installer should be executable.

### PHP 8.0 ###

$ chmod a+x xampp-linux-x64-8.0.1-0-installer.run

### PHP 7.4 ###

$ chmod a+x xampp-linux-x64-7.4.14-0-installer.run

### PHP 7.3 ###

$ chmod a+x xampp-linux-x64-7.3.26-0-installer.run

4. Then run the XAMP installer:

### PHP 8.0 ###

$ sudo ./xampp-linux-x64-8.0.1-0-installer.run

### PHP 7.4 ###

$ sudo ./xampp-linux-x64-7.4.14-0-installer.run

### PHP 7.3 ###

$ sudo ./xampp-linux-x64-7.3.26-0-installer.run


How to Start and use XAMPP on CentOS 8:

XAMPP is installed to /opt/lampp/. To start XAMPP services, run:

$ sudo /opt/lampp/lampp start

To verify installation of XAMPP on CentOS 8 visit the Apache web page:

http://localhost


Stopping and Uninstalling XAMPP on CentOS 8:

To stop XAMPP services run:

$ sudo /opt/lampp/lampp stop

To uninstall XAMPP on CentOS 8, run:

$ cd /opt/lampp
$ sudo ./uninstall
$ sudo rm-rf /opt/lampp