How To Install and Use XAMPP on Centos 7

In this article, we want to teach you How To Install and Use XAMPP on Centos 7.

XAMPP is one of the widely used cross-platform web servers, which helps developers to create and test their programs on a local webserver. It was developed by Apache Friends, and its native source code can be revised or modified by the audience.

XAMPP consists of Apache HTTP Server, MariaDB, and an interpreter for different programming languages like PHP and Perl. It is available in 11 languages and supported by different platforms such as the IA-32 package of Windows & x64 package of macOS and Linux.

How To Install and Use XAMPP on Centos 7

Before you start to install XAMPP, you need to log in to your server as a non-root user with sudo privileges. To do this, you can follow our article the Initial Server Setup with Centos 7.

Now follow the steps below to complete this guide.

Steps To Install XAMPP on Centos 7

First, you need to update your local package index with the following command:

sudo yum update -y

Then, you need to install the wget tool on Centos 7 with the following command:

sudo yum install wget -y

Now visit the Apache Friends Downloads page and copy the Link address of the XAMPP for Linux and use the wget command to download it:

wget https://www.apachefriends.org/xampp-files/8.1.4/xampp-linux-x64-8.1.4-1-installer.run

Set the correct permissions for your downloaded file:

sudo chmod +x xampp-linux-x64-8.1.4-1-installer.run

Next, run your XAMPP installer script:

sudo ./xampp-linux-x64-8.1.4-1-installer.run

You will be asked some questions. Enter y to continue your installation.

When your installation is completed, you will get the following output.

Output
Please wait while Setup installs XAMPP on your computer.

Installing
0% ______________ 50% ______________ 100%
#########################################

----------------------------------------------------------------------------
Setup has finished installing XAMPP on your computer.

Configure XAMPP on Centos 7

At this point, you need to allow everyone to access the XAMPP server on Centos 7.

Open the /opt/lamp/etc/extra/httpd-xampp.conf file and add a line ” Require all granted” and comment out the “Require local“ or delete it.

sudo vi /opt/lampp/etc/extra/httpd-xampp.conf
<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

At this point, restart your XAMPP service on Centos 7 with the command below:

/opt/lampp/lampp restart

Fix cat: error while loading shared libraries on Centos 7

Note: If you are facing the error below while you’re restarting your service:

cat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

You need to edit the file below to fix this error.

sudo vi /opt/lampp/lampp

Then modify:

export LD_ASSUME_KERNEL=2.2.5

to

export LD_ASSUME_KERNEL=2.8.0

After that restart your service again and everything will be fixed.

/opt/lampp/lampp restart
Output
Restarting XAMPP for Linux 8.1.4-1...
XAMPP: Stopping Apache...not running.
XAMPP: Stopping MySQL...not running.
XAMPP: Stopping ProFTPD...not running.
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

Access XAMPP Web Interface

At this point, you can access your XAMPP on Centos 7 through the web interface. Type your server’s IP address in your web browser:

http://domain_name_OR_ip_address
XAMPP welcome screen on Centos 7

If you want to access the phpmyadmin page just type the URL with /phpmyadmin in the address bar.

http://domain_name_OR_ip_address/phpmyadmin
Access XAMPP phpmyadmin

How To Use XAMPP

Once the XAMPP installation is completed you can start and stop each module by using the XAMPP Control Panel. For example, testing PHP applications on your computer, you can start the two modules Apache and MySQL. It will allow PHP programs to run on your computer. This XAMPP software emulates a remote server-like environment on your local computer.

As an app developer, you need to test applications as many times as possible to find and fix the bugs. If you are testing in a local environment like XAMPP, it will speed up your development process.

Before XAMPP every time you need to upload files to a remote server for testing purposes. It will be quite difficult to test on the live server and it is visible to your visitors. But whereas in XAMPP you can easily test and make any updates in your localhost. At any number of times, you can update and test in XAMPP. Once completed you can upload these new updated files to the remote server.

Conclusion

At this point, you learn to Install and Use XAMPP on Centos 7.

Hope you enjoy it.

You may be like these articles:

How To Install XAMPP on Ubuntu 22.04

Install and Configure XAMPP on Rocky Linux 8

Install and Configure XAMPP on AlmaLinux 8

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!