Introduction
The XAMPP stack is a platform that developers use as a local host, giving them a suitable environment for testing software and webpages before transferring data to remote servers.
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).
Learn how to install XAMPP on your CentOS system, how to verify the installation and uninstall the XAMPP package.
For Ubuntu systems, refer to our guide on installing XAMPP on Ubuntu 18.04.
Prerequisites
- CentOS operating system
- A user with sudo privileges
- Access to a terminal/command line
6 Steps For Installing XAMPP On CentOS
Step 1: Download XAMPP Package
1. Start by downloading XAMPP from the official Apache Friends webpage.
2. Find and click on the XAMPP for Linux button on the homepage. Save the file on your CentOS system.
Step 2: Give the Package Executive Permission
Before you can run the installation process, you need to modify the file permission and make it executable.
1. Open the terminal (Ctrl+Alt+F2) and change the directory to the Downloads folder where the XAMPP package is located:
cd Downloads
2. Use the chmod
command to make the file executable with the following command:
chmod +x [package_name]
To find the full package name, navigate to the Downloads folder where you downloaded the XAMPP installation package. Copy and paste the name into the command above.
To make the latest XAMPP installation package executable, enter the command:
sudo chmod +x xampp-linux-x64-7.3.8-2-installer.run
Bear in mind the terminal won’t give any output confirming you have successfully performed the previous step.
Step 3: Run the Installation Wizard
1. Next, run the installer and launch the graphical setup wizard with the command:
sudo ./[package_name]
For the latest XAMPP stack available, use the command:
sudo ./xampp-linux-x64-7.3.8-2-installer.run
2. When prompted, supply the password to verify the command.
3. A new XAMPP Setup Wizard window will open, on top of the terminal:
Step 4: Install XAMPP on CentOS
After the XAMPP welcome screen opens, proceed through the installation configuration.
1. Click on the Next button. In the following Select Components dialogue, decide which components to install. We recommend keeping the default settings and continuing with Next.
2. Then, the wizard displays the directory where the software will be installed. To continue, click Next.
3. The package offers to install sponsored applications (WordPress, Joomla, Drupal, and others) on top of the XAMPP installation. You can opt-out of installing additional software by unchecking the Learn more about Bitnami for XAMPP box.
4. Once everything is set, the wizard prompts ready to install XAMPP on your CentOS. Click on Next to launch installation.
5. The installation process starts and a dialogue box displaying the progress bar will appear on your screen.
6. Complete the process by clicking on Finish.
Step 5: Launch XAMPP
XAMPP will launch its control panel. Open the Manage Servers tab to see the available services and check their status.
In it, you will see the MySQL Database, ProFTPD, and Apache Web Server. In the example below, two out of three of the servers aren’t running.
Select a server and click on Start to enable it.
To check whether you have successfully set up the stack, power all the available servers.
Step 6: Verify XAMPP is Running
Make sure XAMPP stack running smoothly on your CentOS system in the following two steps.
1. Enter the following URL in a browser to check if the localhost is working:
http://localhost/dashboard
If the XAMPP dashboard page appears, you have successfully installed the stack.
2. Verify MariaDB service is running, by opening the URL:
http://localhost/phpmyadmin
The phpMyAdmin homepage will display as in the image below:
Once the XAMPP installation is complete, using the XAMPP control panel you can start and stop each module for testing purposes. For example, when testing PHP applications, you can start the two modules Apache and MySQL allowing PHP programs to run on your computer.
This XAMPP software emulates a remote-server-like environment, so when you need to test applications often, to fix bugs, it allows you to speed up your development process.
How to Uninstall XAMPP
1. To uninstall the XAMPP stack, return to the terminal (Ctrl+Alt+F2) and move to the opt/lampp
directory by typing:
cd /opt/lampp
2. Next, use the following command to uninstall XAMPP:
sudo ./uninstall
3. A dialogue box will appear asking you whether you want to remove XAMPP and all of its modules. Click on Yes to confirm.
Lastly, the output will show you: Uninstallation completed.
4. Finally, remove the specified directory with:
sudo rm –r /opt/lamp
Conclusion
This article has shown you how to successfully install the XAMPP stack on a CentOS system. You also learned how to launch XAMMP, verify installation and uninstall XAMPP.
You can also explore similar alternatives such as the LAMP stack or the MEAN stack.