How to install XAMPP on CentOS/RHEL 6.5

In this tutorial we will learn,how to install XAMPP in CentOS/RHEL 6.5.We will install XAMPP version 1.8.3. XAMPP is a open source cross platform software stack package mainly used for web server solution. XAMPP is available for Windows,MAC OSX,Solaris and Linux(WAMP, MAMP, SAMP, LAMP).

XAMPP stands for
X = Cross Platform (Windows,MAC OSX,Solaris and Linux)
A = Apache
M = MySQL
P = PHP
P = Perl

NOTE: SELINUX is in Enforcing mode

Install XAMPP on CentOS/RHEL

Follow the given below steps to install XAMPP on CentOS/RHEL 6.5

Step 1: Download the XAMPP
We suggest you to download latest stable XAMPP package for Linux.You can download the XAMPP from this URL.

We have downloaded the XAMPP package version 1.8.3-3

You can download the XAMPP package from sourceforge.net

Step 2: Transfer the file to Server

After downloading the XAMPP package into your system,transfer the file by using scp command

Alternatively, directly in Server terminal,you can use wget command to download the package if you have downloading URL address.
Example:

yum install wget
wget http://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/1.8.3/xampp-linux-x64-1.8.3-3-installer.run 

Step 3 : Give executable permission to downloaded XAMPP script
Give executable permission to downloaded XAMPP script.In our case, we have downloaded the file xampp-linux-x64-1.8.3-3-installer.run (The file name may be different in your case depends upon latest package and architecture of Operating system)

chmod +x xampp-linux-x64-1.8.3-3-installer.run

Step 4: Run XAMPP installer script
Run the XAMPP installer script.While script is running,it will ask some question.Give the answer as per your requirement. The script will install the XAMPP stack in /opt/lampp directory. You can change this path at the time of installation.

./xampp-linux-x64-1.8.3-3-installer.run 

----------------------------------------------------------------------------
Welcome to the XAMPP Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want 
to install. Click Next when you are ready to continue.

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.


Step 4: Allow ALL network to access XAMPP Server

I did troubleshooting after installing XAMPP,hence directly writing solution in this step.You can read about the Error and its solution from this post.

Edit the last section of file called httpd-xampp.conf.Add new line Require all granted and comment the line Require local by using # sign

vi /opt/lampp/etc/extra/httpd-xampp.conf
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    # Require local
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

Step 5 : Restart all services by using lampp script
Restart all the services by using below given command

/opt/lampp/lampp restart

Below given is the reference from my system

[root@localhost ~]# /opt/lampp/lampp restart
Restarting XAMPP for Linux 1.8.3-3...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...not running.
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
[root@localhost ~]# 

Step 6: Now open the XAMPP in Web browser

Now open the web browser and type the URL or ip-address in address bar
The XAMPP dashboard will be open

Install XAMPP

Step 7: Open phpmyadmin

To open phpmyadmin of XAMPP,simply type URL of server with /phpmyadmin in address bar

Example : Replace 192.168.56.102 with your XAMPP server ip address(run ifconfig command to get your server ip)

http://192.168.56.102/phpmyadmin

xampp phpmyadmin

28 thoughts on “How to install XAMPP on CentOS/RHEL 6.5”

  1. Hi,

    My Xampp is running with old version so I would like to update the Xampp in centos7 with out Data lose.Please suggest to me how to update it.

    Reply
  2. How do i change the default port 80 to 808X
    i make the changes in /opt/lampp/etc/httpd.conf file
    listen 80 change to 808x.
    and restart the xampp,
    [root@ip-192-168-140-123 ~]# /opt/lampp/lampp restart
    Restarting XAMPP for Linux 5.6.28-1…
    XAMPP: Stopping Apache…not running.
    XAMPP: Stopping MySQL…ok.
    XAMPP: Stopping ProFTPD…not running.
    XAMPP: Starting Apache…fail.
    XAMPP: Another web server is already running.
    XAMPP: Starting MySQL…ok.
    XAMPP: Starting ProFTPD…fail.
    XAMPP: Another FTP daemon is already running.

    how to resolve this.

    Reply
    • Hi Ritesh,

      Check the logs for Apache get failed to start. It may have following reasons –
      1. Typo mistake while editing the httpd.conf
      2. Port number conflict. So custom port number should not used in any other application and should be more than 1024 i.e called “well known ports”.

      In httpd.conf, find the given below parameters and change the port number. Restart the xampp after editing the file.

      Listen 80
      ServerName localhost:80
      

      Regards
      Sharad

      Reply
      • Hi Sharad,

        I would like to update my xampp with new version in centos 7 with out data lose.
        Please suggest to me how to update it.

        Reply
        • Hello Sanjeevi,

          Xampp update won’t lose your data. It update the package which may result to new configuration file in system. Hence, to avoid any type of error we take backup of both configuration and data.

          For an example, if XAMPP has apache 2.0 after upgrade it is apache 2.4 then in configuration you will surely find the new parameters which may lead to httpd restart error.But this can be fixed by re-writing the config appropriate to apache 2.4 version.

          Strongly advice to do testing first in some Virtual Machine or testing machine before going to update/upgrade in main XAMPP server.

          Regards
          Sharad

          Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.