Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

How to install Xampp on Linux

How to install Xampp on Linux

In this tutorial we are going to learn Installing latest version of Xampp on Linux , setting Linux htdocs folder permissions issue, How to add a Linux environment variable for PHP, Installing Composer “A Dependency Manager for PHP”.

XAMPP is a completely free, easy to install Apache distribution containing MySQL / MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use. Best part is Xampp is cross-platform tool available for Windows , Mac and Linux.

We are going to break this tutorial in several parts to make this tutorial easy to use :

Part 1 : Xampp Installation

visit to download latest version of xampp. like I have downloaded xampp in /home/sanjay/download directory

Now Open Terminal / Konsole and using cd command move
to /home/sanjay/download

Now run command
sudo chmod 755 xampp-linux-*
sudo ./xampp-linux-*

Part 2 :  Fixing Linux htdocs folder permissions issue

Now Open Terminal / Konsole and run commands given below

sudo chown -R daemon:daemon /opt/lampp/htdoc
sudo chmod 777 -R /opt/lampp/htdocs

Part 3 : Setting PHP environment variable

Method 1 (use when method 2 fails) :
sudo nano /etc/environment
in last and save and run
sudo ln -s /opt/lampp/bin/php /usr/local/bin/php

Method 2 (Recommended ) :

export PATH=$PATH:/opt/lampp/bin/php
sudo ln -s /opt/lampp/bin/php /usr/local/bin/php


export PATH=$PATH:/opt/lampp/bin/mysql
sudo ln -s /opt/lampp/bin/mysql /usr/local/bin/mysql

Part 4 : Installing Composer

curl -sS | php
sudo mv composer.phar /usr/local/bin/composer

Part 5: Xampp Control Panel GUI

sudo nano /usr/share/applications/firefox-developer.desktop
and paste

[Desktop Entry]
Comment=XAMPP Control Panel
Name=XAMPP Control Panel
GenericName=XAMPP Control Panel

then press CTRL+X and type y and Press Enter.

Xampp Common commands

sudo /opt/lampp/lampp start (Will Start Xammp)
sudo /opt/lampp/lampp stop (will Stop Xampp)
sudo /opt/lampp/lampp restart (will restart Xampp)

Xampp configurable files

The main XAMPP configuration files are located as follows:

Apache configuration file: /opt/lampp/etc/httpd.conf, /opt/lampp/etc/extra/httpd-xampp.conf
PHP configuration file: /opt/lampp/etc/php.ini
MySQL configuration file: /opt/lampp/etc/my.cnf
ProFTPD configuration file: /opt/lampp/etc/proftpd.conf

If you still facing any problem then please comment your problem , I will try to fix those problems.

5 1 vote
Article Rating
Notify of

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

Newest Most Voted
Inline Feedbacks
View all comments
Sassank Sethi

You save my whole the day, thanks ….