How To Install XAMPP on Rocky Linux 9

This guide will teach you How To Install and Configure XAMPP on Rocky Linux 9.

XAMPP is an acronym for Cross-Platform, Apache, MySQL, PHP, and Perl, with the Ps for PHP and Perl, respectively. It’s an open-source web-solutions kit that provides Apache delivery for various servers and command-line executables, as well as Apache API, MariaDB, PHP, and Perl modules.

It is a framework that provides a suitable environment for testing and verifying the functionality of projects based on Apache, Perl, MySQL, and PHP using the host’s framework. 

Steps To Install and Configure XAMPP on Rocky Linux 9

To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with Rocky Linux 9.

Install Required Packages for XAMPP Installation

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

sudo dnf -y update

Then, install the required packages on Rocky Linux 9 by using the following command:

sudo dnf install libnsl wget

Install XAMPP Server on Rocky Linux 9

At this point, you need to visit the XAMPP Downloads page and get the latest release of XAMPP matching desired PHP version for your application requirements.

sudo wget https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/8.1.10/xampp-linux-x64-8.1.10-0-installer.run

When your download is completed, set the correct permissions for it with the following command:

sudo chmod a+x xampp-linux-*-installer.run

Run XAMPP Installer Script

At this point, use the following command to run the XAMPP script installer on Rocky Linux 9:

sudo ./xampp-linux-x64-8.1.10-0-installer.run

Select components to install:

Output
----------------------------------------------------------------------------
Welcome to the XAMPP Setup Wizard.
----------------------------------------------------------------------------
XAMPP Core Files : Y (Cannot be edited)
XAMPP Developer Files [Y/n] :y
Is the selection above correct? [Y/n]: y
----------------------------------------------------------------------------
Installation Directory
XAMPP will be installed to /opt/lampp
Press [Enter] to continue:
----------------------------------------------------------------------------
Setup is now ready to begin installing XAMPP on your computer.
Do you want to continue? [Y/n]: y
----------------------------------------------------------------------------
Please wait while Setup installs XAMPP on your computer.

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

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

Configure XAMPP on Rocky Linux 9

At this point, you need to allow everyone to access the XAMPP server on Rocky Linux.

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

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>

When you are done, save and close the file.

Installation files of XAMPP are inside the /opt/lampp directory on Rocky Linux 9:

cd /opt/lampp

To list the usage options, run the command below:

sudo ./xampp --help
Output
Usage: xampp <action>
start Start XAMPP (Apache, MySQL and eventually others)
startapache Start only Apache
startmysql Start only MySQL
startftp Start only ProFTPD

stop Stop XAMPP (Apache, MySQL and eventually others)
stopapache Stop only Apache
stopmysql Stop only MySQL
stopftp Stop only ProFTPD

reload Reload XAMPP (Apache, MySQL and eventually others)
reloadapache Reload only Apache
reloadmysql Reload only MySQL
reloadftp Reload only ProFTPD

restart Stop and start XAMPP
security Check XAMPP's security

enablessl Enable SSL support for Apache
disablessl Disable SSL support for Apache

backup Make backup file of your XAMPP config, log and data files

oci8 Enable the oci8 extenssion

panel Starts graphical XAMPP control panel

While running the above command, get the following error:

XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system.

You can fix it by installing the following package on Rocky Linux 9:

sudo dnf install libxcrypt-compat

Then re-run the ./xampp --help command, and it will work.

Start XAMPP Service

Now from your XAMPP directory, run the following command to start your service:

# cd /opt/lampp 
# sudo ./xampp start
Output
Starting XAMPP for Linux 8.1.10-0...
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 Rocky Linux 9 through the web interface. Type your server’s IP address in your web browser:

http://server-ip_address

You will see your XAMPP welcome page:

XAMPP Rocky Linux 9

To see your PHP information, you can click on the PHPInfo at the top of the screen.

Also, to access the phpMyAdmin page you can click on the phpMyAdmin at the top of the screen.

Or you can type the URL with /phpmyadmin in the address bar:

http://server_ip_address/phpmyadmin

Conclusion

At this point, you have learned to Install and Configure XAMPP on Rocky Linux 9.

Hope you enjoy it.

You may be like these articles:

Set up Java_Home Path on Debian 11

How To Clear DNS Cache in Linux

How To Install PowerDNS on Debian 11

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!