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 :http://www.apachefriends.org/en/xampp-linux.html

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

</IfModule>

</IfModule>
===========================
Change this to:

==========================
User yourUserName

Group nogroup

</IfModule>

</IfModule>
==========================

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.
http://localhost/test.PHP

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
Thanks
Gihan


Actions

Information

38 responses

10 06 2011
Janani Nayanathara

great………….😀

11 06 2011
ජයංග

this is really nice dude keep it up

21 06 2011
keerthana

good job Malan…keep it up…

3 07 2011
crimit

hi

11 07 2011
Fizwhiz

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
Gihan

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
Fizwhiz

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!

Respect,
Fizwhiz

14 07 2011
Gihan

Good luck with your work Fizwhiz, and you are welcome…😀

25 09 2011
bl4ck

it’s very use full thank you very much gihan ……………..🙂

:shakehand ….

7 10 2011
shahan

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
lay

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

15 11 2011
Gihan

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
leoanto

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

17 11 2011
Gihan

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😀.

17 11 2011
leoanto

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 link..so i will try that one…

17 11 2011
Gihan

I think bond version of XAMPP is available only for windows. So try separate tomcat installation : https://gihansblog.wordpress.com/2011/07/29/how-to-install-apache-tomact-server-on-ubuntu-11-04/

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
leoanto

thanks i will try jsp in seperate tomcat installation….

8 12 2011
walshy

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
Gihan

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
Gihan

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
Gihan

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
Timjay

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 config.inc.php 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
hillary

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)
Aborted

6 05 2012
phpblast

I good I also found easiest way of installing xampp on linux 32 bit as well as 64 bit distro
http://www.cellguru.co.cc/2012/05/easy-way-install-xampp-on-64-bit-linux.html

24 05 2012
wildan

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?
tanks

17 06 2012
pragendra

thanks gihan for this help it works well

4 07 2012
Chafic

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
phpblasty

Great tutorial , thanks for sharing, a easy way to install Xampp on 32/64 bit (for novice ) Linux distro can be found here
http://html5planet.blogspot.in/2012/07/install-xampp-on-3264-bit-linux-distro.html

22 08 2012
TechToyz

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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s




%d bloggers like this: