First, download XAMPP (linux version) for Ubuntu.
Download link: Click Here
Keep in mind when you download it, remember the location where you save the downloaded file. Now, suppose you download and save the file in desktop.
Open terminal (Ctrl+Alt+T) and go to desktop.
Extract the downloaded archive file to /opt:
$ sudo tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt
To start XAMPP, just type in terminal
$ sudo /opt/lampp/lampp start
You will see something like below in your screen
Starting XAMPP 1.7.3a…
LAMPP: Starting Apache…
LAMPP: Starting MySQL…
To stop it just type
$ /opt/lampp/lampp stop