How to install XAMPP on Linux (Ubuntu 11.04)
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 :D .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
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 :D .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
great............. :D
ReplyDeletethis is really nice dude keep it up
ReplyDeletegood job Malan...keep it up...
ReplyDeletehi
ReplyDeleteDear 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:
ReplyDeleteStarting 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!
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:
ReplyDeletesudo 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 :-)
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!
ReplyDeleteRespect,
Fizwhiz
Good luck with your work Fizwhiz, and you are welcome... :D
ReplyDeleteit's very use full thank you very much gihan ................. :)
ReplyDelete:shakehand ....
I want to completely remove xampp from my system. I am using LinuxMint 11 (exactly same like the ubuntu 11.04, just modified.)
ReplyDeleteWhen 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.
Hi. I'm using Ubuntu 11.10. Where is the Xampp launcher located?
ReplyDeletelaunch it with linux terminal window, if you have successful installed as described, run it like this
ReplyDeletesudo /opt/lampp/lampp start
where to put the jsp code to in xampp to run it.
ReplyDeletePut 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.
ReplyDeletei 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...
ReplyDeleteI think bond version of XAMPP is available only for windows. So try separate tomcat installation : http://gihansblog.wordpress.com/2011/07/29/how-to-install-apache-tomact-server-on-ubuntu-11-04/
ReplyDeleteBut 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. :-)
thanks i will try jsp in seperate tomcat installation....
ReplyDeleteI installed lampp succesfully and it tested fine (the sample pages in 'htdocs').
ReplyDeletethe 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!
Try to clear the cache and restart the server, check it's working.
ReplyDeleteSir I have a question I already downloaded the xampp for linux and after the step 2 i got this kind of error:
ReplyDelete"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!
I downloaded xampp-linux-1.7.7.tar.gz. I already triend changing .4 to .7 but still same error.
ReplyDelete“md5sum: xampp-linux-1.7.7.tar.gz: No such file or directory”
please help. . .
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 :D
ReplyDeleteThe 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!!!
ReplyDeletetar (child): xampp-linux-1.7.7.tar.gz: Cannot open: No such file or directory
ReplyDeletetar (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
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.
ReplyDeleteGihan, 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:
ReplyDelete"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?
[...] 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. [...]
ReplyDeletehow 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
ReplyDeleteits a wonderfull tutorial...I done with xampp.... :D
ReplyDeletewhat could be the issue here
ReplyDeleteMobile 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
I good I also found easiest way of installing xampp on linux 32 bit as well as 64 bit distro
ReplyDeletehttp://www.cellguru.co.cc/2012/05/easy-way-install-xampp-on-64-bit-linux.html
hay gihan I try to start and show this
ReplyDeleteStarting 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
thanks gihan for this help it works well
ReplyDeleteThank you very much sir :)
ReplyDeleteG'day and thanks for this. I managed to successfully install Xampp with your help, but...
ReplyDeletefor 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?
Great tutorial , thanks for sharing, a easy way to install Xampp on 32/64 bit (for novice ) Linux distro can be found here
ReplyDeletehttp://html5planet.blogspot.in/2012/07/install-xampp-on-3264-bit-linux-distro.html
Nice Article
ReplyDeleteReblogged this on Muhammed Refaai and commented:
ReplyDeleteAmazing trick, no need to "gksu nautilus" anymore!
Many of the products are produced in a clean room environment, and that can make it difficult
ReplyDeletefor people to do the work in the area. It pulls the air upward, then through a system of filters.
An axis of motion can be both linear (X,Y,Z) and also rotational (A,B,C).
you're really a just right webmaster. The site loading pace is amazing.
ReplyDeleteIt kind of feels that you're doing any unique trick. Also, The contents are masterpiece.
you've done a great activity on this subject!