Monday, November 5, 2012

How to install XAMPP correctly in Linux (Ubuntu 12.04)


When you want to install Apache 2.0 server to try and test your services in the local computer, Apache XAMPP is an easy and straightforward solution which comes with combined MySQL and PHP packages.  Following is what you should do to install and run XAMPP in your computer.

1. Download latest version(or an older version if you need) of XAMPP from the 'XAMPP for Linux' page.

2. Use the following command and extract the downloaded distribution into /opt directory.

               sudo tar xvfz xampp-linux-1.8.1.tar.gz  -C /opt

You can replace xampp-linux-1.8.1.tar.gz with the version you have.

3. This will extract the content of XAMPP directory into /opt/lampp/. Now let's start the XAMPP server. Use the following command.
  
               sudo /opt/lampp/lampp start 

If all the configurations are correct XAMPP server will start now as follows.

Starting XAMPP for Linux 1.8.1...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for Linux started.


 4. Goto http://localhost from your browser and test whether this is correctly installed and started. You will be first directed to the language selection page and then the welcome page would be appeared as shown below.

XAMPP welcome page
 
 5. Stop the server when you are done :)


               sudo /opt/lampp/lampp stop 

 ...................................................................................................................................................

If everything goes fine as this you are good to go. However there may be times when you get error messages like this.

Starting XAMPP for Linux 1.8.1...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Another MySQL daemon is already running.
XAMPP: Starting ProFTPD...
XAMPP for Linux started.


What this means is that XAMPP-MySQL is not started as you have another mysql-server instance is running in your local computer. Most probably you may have installed mysql-server-5.0 (or older version) previously into your computer. Therefore to start MySQL in XAMPP distribution we have to first stop this service. Use the following command.

            sudo service mysql stop  

The running mysql service will be stopped. Simple start the XAMPP server back and problem is fixed now :) Do the same and stop the apache2 service if you see that Apache server too hasn't started.

XAMPP: Another web server daemon is already running.
Use,     sudo service apache2 stop 

 

13 comments:

  1. thank you a lot .
    "
    XAMPP: Another web server daemon is already running.
    XAMPP: Another MySQL daemon is already running.
    "
    sudo service apache2 stop
    sudo service mysql stop
    then my problem is solved :)

    ReplyDelete
  2. It should be noted that as of Jan. 2013, XAMPP is only supported on the 32-bit version of Ubuntu. You cannot install XAMPP if you are using 64-bit.

    ReplyDelete
  3. Yes XAMPP is a 32 bit application, you can cross check whether you have installed a 32 or 64 bit . Run at #file /sbin/file ----

    /sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x7aa29ded613e503fb09fb75d94026f3256f01e7a, stripped ---- Will show the OS at 64 bit

    To use the XAMPP is a 32 bit application Run # apt-get install ia32-libs ----- will fetch more library file from the ubuntu repos

    nanchahal@gmail.com

    ReplyDelete
  4. still phpmyadmin access forbidden

    ReplyDelete
    Replies
    1. if you want to use phpmyadmin just go on the terminal to /opt/lampp/etc/extra
      then use nano : sudo nano httpd-xampp.conf

      it will open a config file
      clos to the document's end you'll find a "Deny from all"
      change Deny for Allow

      save the document and that's all just restart lampp

      Delete
  5. Thank you very much, I was looking for some instructions - I have done it many times in Windows, but this is my first time in Ubuntu Linux.
    TR

    ReplyDelete
  6. Rohit...I just read it here now also...previous blog of Ishara:
    http://isharapremadasa.blogspot.com/2012/11/resolving-new-xampp-security-concept.html

    ReplyDelete
  7. hey i have problem with the 2nd step while installing the xampp. plz help....it is showing error "tar: You may not specify more than one `-Acdtrux' or `--test-label' option
    Try `tar --help' or `tar --usage' for more information."

    ReplyDelete
  8. Thank you very much.. it helped me...

    ReplyDelete
  9. I'm running Dream Studio 64 bit based on 12.04.1 LTS so I ran tried Sidharatha's solution with apt-get install ia32-libs but I was presented with a dependancy issue:
    The following packages have unmet dependencies:
    ia32-libs : Depends: ia32-libs-multiarch
    E: Unable to correct problems, you have held broken packages.

    I tried to get ia32-libs-multiarch but got:
    The following packages have unmet dependencies:
    ia32-libs-multiarch:i386 : Depends: libcanberra-gtk-module:i386 but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.

    Any ideas, anyone?

    ReplyDelete
  10. hi...Im student from Informatics engineering nice article,
    thanks for sharing :)

    ReplyDelete
  11. hi
    i have problem
    after installed xampp
    but localhost/xampp
    is given by object not found

    ReplyDelete