How to install XAMPP on Linux (Ubuntu 11.04)

9 06 2011

Hi, this is my second post.In first post I mentioned about how to run & configure XAMPP on windows computer. XAMPP may be the best server to PHP. Now its time to move into Linux. Currently I’m using Ubuntu 11.04 Natty Narwhal edition. Based on that I’ll show you how to install XAMPP on Linux OS.

Earlier day the Linux version of XAMPP called as LAMPP. But it comes as XAMPP with more improvements.

Ok, First of all you need to download the XAMPP for Linux form Apachi Friends.
here is the link for it :

Before installation , its better to have a MD5 check.To do that you need to login as root user.
1) Now press (Clrt+Alt+T) to open Terminal window
then type sudo -s -H
it will ask your password after that
2) type md5sum xampp-linux-1.7.4.tar.gz
the displaying MD5 should be 7d83c9829d8c79d43ea607e5b009dc58

3) Now you should extract the downloaded archive file to /pot directory

command: tar xvfz xampp-linux-1.7.4.tar.gz -C /opt

You shouldn’t use any extracting tool to extract the archive, it won’t work.And if you already installed a XAMPP version, it will overwritten by this command.Now XAMPP is installed below the /opt/lampp directory.

Now you can check whether XAMPP is working.

command: sudo /opt/lampp/lampp start
you will see a message like this

Ok now XAMPP is working ๐Ÿ˜€ .But still there is a problem. Your php testing folder is “htdocs”. You can simply move into itย  File System–>opt–>lampp–>htdocs

You will noticed that it won’t allow you to put .php file or any thing. Because you haven’t owe the permission yet. Because it belongs to root user.

Change the ownership XAMPP to your user account!

In this case also you need to login as root user.
Now press (Clrt+Alt+T) to open Terminal window
command: sudo -s -H

Now move to lampp folder
command: cd /opt/lampp/

command: chown -R yourUserName:yourUserName htdocs

Important: Here yourUserName is just your user account name of Linux

Also you need to associate ownership of your Linux username with the Apache configuration. In this case move to “etc” folder:

command: cd /opt/lampp/etc/
Now you are in the etc directory. Type gedit httpd.conf. This will show the Linux text editor.

command: gedit httpd.conf

But be careful when editing; a single mistake can make the Apache web server inoperable.
Then find (press Ctrl+F) the following line in that text file..

The text file look like this…

User nobody

Group nogroup


Change this to:

User yourUserName

Group nogroup



A picture of the text file on my computer…

Now you can reboot the computer..
After that open the terminal (Ctrl+Alt+T)

then start XAMPP
command: sudo /opt/lampp/lampp start

Then go to firefox type this on address bar http://localhost/
It will take you to the XAMPP welcome page..
Now you can start programming php scripts.. put your PHP script files into “htdocs” folder as I mentioned earlier.
If your php script name is test.PHP ,type this on address bar of firefox.

If you are a beginner and want an test php script.Here it is…

See you in post with How to configure MySQL database (phpMyAdmin) in XAMPP

Enjoy it




38 responses

10 06 2011
Janani Nayanathara

great…………. ๐Ÿ˜€

11 06 2011

this is really nice dude keep it up

21 06 2011

good job Malan…keep it up…

3 07 2011


11 07 2011

Dear Gihan, firstly, thank you so much for this wonderful tutorial! It’s honestly been much more successful than my previous attempt at installing a LAMP stack on my own (I’m a new linux user and developer). However, every time I fire up XAMPP using the following command: sudo /opt/lampp/lampp start, I get the following:
Starting XAMPP for Linux 1.7.4…
XAMPP: Starting Apache with SSL (and PHP5)…
XAMPP: Starting MySQL…
XAMPP: Another FTP daemon is already running.
XAMPP for Linux started.

And when I stop it, naturally, I get something like this:
Stopping XAMPP for Linux 1.7.4…
XAMPP: Stopping Apache with SSL…
XAMPP: Stopping MySQL…
XAMPP: XAMPP-ProFTPD is not running.
XAMPP stopped.

I’ve googled this trouble extensively for over an hour and I haven’t found a reasonable solution. Firstly, should I be worried about this? If so, then the common solution seems to be using ps aux | grep ftp in order to find the process using the FTP and kill it, but I’m unable to kill ProFTPD for some bizarre reason. Please advise!

11 07 2011

ProFTPD is a FTP server which already included in XAMMP. And Fizwhiz , you said that you tried LAMMP. If it is so I think the problem is LAMMP was not completly removed. an FTP server is still in it. So that why you are getting message like “Another FTP daemon is already running..” If you can still run http://localhost and not using advantages of FTP server,I think nothing to worry. But if you face any problems, it’s better to remove XAMPP and remove the existing FTP server manually. Then try to install XAMPP. To remove FTP server use this:
sudo apt-get remove ftp and it should be done after removing XAMPP. Then have a clean installation of XAMPP. ๐Ÿ™‚

If you have any doubt, do not hesitate to ask. Thanks ๐Ÿ™‚

14 07 2011

Gihan, thanks so much for the prompt response! I got rid of LAMPP and then reinstalled XAMPP in addition to removing ftp, but somehow something else got messed up in the process where the Apache server wasn’t being recognized. I figured it would make my life a lot easier if i just reinstalled ubuntu (Live CD) and repeated the process properly. I just successfully installed XAMPP on my new ubuntu, thanks so much for the straight forward and clear tutorial!


14 07 2011

Good luck with your work Fizwhiz, and you are welcome… ๐Ÿ˜€

25 09 2011

it’s very use full thank you very much gihan …………….. ๐Ÿ™‚

:shakehand ….

7 10 2011

I want to completely remove xampp from my system. I am using LinuxMint 11 (exactly same like the ubuntu 11.04, just modified.)

When I press http://localhost then it ask for the username and password. As I had a previously installed Xampp and I forgot for that one.

15 11 2011

Hi. I’m using Ubuntu 11.10. Where is the Xampp launcher located?

15 11 2011

launch it with linux terminal window, if you have successful installed as described, run it like this

sudo /opt/lampp/lampp start

16 11 2011

where to put the jsp code to in xampp to run it.

17 11 2011

Put them into this directory /xampp/tomcat/webapps . And to do this, you should have latest version of XAMPP bond with Tomcat or Tomcat addone. I assume you have it :D.

17 11 2011

i downloaded the tomcat from official website and extracted it…it contains the htdocs folder for running php … but i dont find tomcat folder itself…please give the xampp bond version download i will try that one…

17 11 2011

I think bond version of XAMPP is available only for windows. So try separate tomcat installation :

But still there is way to add tomcat into existing XAMPP.If you can manage I’ll provide instructions.I don’t know If you are a novel, you should try JSP in separate tomcat installation. ๐Ÿ™‚

18 11 2011

thanks i will try jsp in seperate tomcat installation….

8 12 2011

I installed lampp succesfully and it tested fine (the sample pages in ‘htdocs’).
the next day I try it, it defaults to looking at var/www/index.html.
why did it change?
Plus, I can no longer login to phpmyadmin!

8 12 2011

Try to clear the cache and restart the server, check it’s working.

12 12 2011
Janno Reyes

Sir I have a question I already downloaded the xampp for linux and after the step 2 i got this kind of error:

“md5sum: xampp-linux-1.7.4.tar.gz: No such file or directory”

please help I really need to install XAMPP because I will use it for web development. (Im just new in linux OS) please help me to finish my installation I hope to hear from you soon Sir Gihan thank you very much!

12 12 2011
Janno Reyes

I downloaded xampp-linux-1.7.7.tar.gz. I already triend changing .4 to .7 but still same error.

โ€œmd5sum: xampp-linux-1.7.7.tar.gz: No such file or directoryโ€

please help. . .

13 12 2011

Hello Janno Reyes, actually the command is md5sum xampp-linux-1.7.7.tar.gz not md5sum: xampp-linux-1.7.7.tar.gz if check carefully you will see you have typed “:” after md5sum and this step is not necessary. It is additional thing to check your downloaded file is a correct file. You can just ignore that step and follow other. If you have any doubt regarding this feel free to ask ๐Ÿ˜€

14 12 2011
Janno Reyes

The error message in step 2 is “xampp-linux-1.7.7.tar.gz: No such file or directory” and if I jump to step 3, still there is an error message “xampp-linux-1.7.4.tar.gz: Cannot open: No such file or directory” please help thanks a lot!!!

15 12 2011

You should run those command after going to your current directory. If your xampp-linux-1.7.7.tar.gz is in the Desktop. First of all you should go to Desktop directory( cd Desktop). Then try to run the command! I assume that’s the problem you have.

14 12 2011
Janno Reyes

tar (child): xampp-linux-1.7.7.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Thats the error what I always have

6 02 2012

Gihan, thanks for you blogs, they give me confidence while working with my linux box. This time I am trying to setup xdebug on my Linux Mint 12 for PHP development, but any time I install xdebug it makes my XAMPP to malfunction. When I launch localhost what I will get is:

“It works! This is the default web page for this server. The web server software is running but no content has been added, yet.”

Pls, what can I do to solve this problem and what actually am I not doing well? Can you tell me how best to install and configure xdebug on linux mint 12 in other not to have this problem?

10 03 2012
Lubuntu, installing xampp + eclipse « PswApps28's Blog

[…] probably suffice. Treats editing the httpd.conf file, and the file of phpMyAdmin gihan: Also treats editing the httpd.conf file arduino: Setting up groups, maybe not necessary. […]

21 03 2012
vishal gaiwkad

how to add php files and see them on browser in case of LINUX server..plz..give me details..step by step i nedd it urgently..thank you

14 04 2012
Amarjeet Kawathe

its a wonderfull tutorial…I done with xampp…. ๐Ÿ˜€

20 04 2012

what could be the issue here
Mobile etc # gedit httpd.conf

(gedit:30096): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported

GLib-GIO:ERROR:/build/buildd/glib2.0-2.28.6/./gio/gdbusconnection.c:2279:initable_init: assertion failed: (connection->initialization_error == NULL)

6 05 2012

I good I also found easiest way of installing xampp on linux 32 bit as well as 64 bit distro

24 05 2012

hay gihan I try to start and show this
Starting XAMPP for Linux 1.8.0-beta4…
XAMPP: XAMPP-Apache is already running.
XAMPP: Another MySQL daemon is already running.
XAMPP: XAMPP-ProFTPD is already running.
XAMPP for Linux started.

how to remove the another mysql daemon?

17 06 2012

thanks gihan for this help it works well

4 07 2012

Thank you very much sir ๐Ÿ™‚

17 07 2012
Peter Grimley

G’day and thanks for this. I managed to successfully install Xampp with your help, but…
for some reason, “sudo -s -H” didn’t work for me (Ubuntu 11.10)
I did something else (can’t remember what) which did work, only now I seem to have lost some privileges although all boxes are ticked I cannot access synaptic, software centre, update manager or Ubuntu one.
Any ideas?

28 07 2012

Great tutorial , thanks for sharing, a easy way to install Xampp on 32/64 bit (for novice ) Linux distro can be found here

22 08 2012

Nice Article

6 10 2012
Mohamed Refai

Reblogged this on Muhammed Refaai and commented:
Amazing trick, no need to “gksu nautilus” anymore!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: