Minggu, 04 Maret 2012

Installation XAMPP on Linux (Ubuntu 11.04)

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.
  1. Now press (Clrt+Alt+T) to open Terminal window
  2. command: sudo -s -H
  3. Now move to lampp folder
  4. command: cd /opt/lampp/
  5. command: chown -R yourUserName:yourUserName htdocs
  6. Important: Here yourUserName is just your user account name of Linux
  7. Also you need to associate ownership of your Linux username with the Apache configuration. In this case move to “etc” folder:
  8. command: cd /opt/lampp/etc/
  9. Now you are in the etc directory. Type gedit httpd.conf. This will show the Linux text editor.
  10. 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
Thank's for Gihan