Wednesday, April 18, 2012

installing LAMPP in Ubuntu

I finally felt it was the right time to learn php, and now here's the thing about php, you actually need to set up a virtual server on your own machine to test your php files. So here is how to set up the server:-

  1. Go to http://www.apachefriends.org/en/xampp-linux.html and download the files.
  2. Once downloaded, extract them.
  3. Open up terminal and type in sudo nautilus
  4. Move the extracted lampp folder to /opt/
  5. To start the server type the following command in terminal sudo /opt/lampp/lampp start
If you get a message saying that any service is already running, that is because well they are... so say for instance if you have installed apache (the web server) because you were following some instructions saying you needed to or some other reason , well either un-install it or you will have to do sudo killall "the service which was already running" each time you want to run the lampp server

To test your php files all you need to do is create a directory within the /opt/lampp/htdocs/ folder and place the files inside it. Now fire up the browser with /localhost/"name of folder created in htdocs"/"name of php file".php

No comments:

Post a Comment