How to run PHP files on localhost?

October 30, 2008 by: Ranjith

1. First download the xampp from http://www.apachefriends.org/en/xampp.html
2. Extract the file and double click the exe. This will install Mysql and Apache servers.
3. Once the installation is complete, you will find XAMPP under Start / Programs / XAMPP. You can use the XAMPP Control Panel to start/stop all servers. Start Mysql and Apache servers.
4. Write a test.php file and copy it in to C:/Program Files/XAMPP/htdocs/
5. To run the php file, you just need to brows http://localhost/test.php

Note: You can also create any folder inside htdocs and past test.php inside the folder. If you create a folder called test then the address will become http://localhost/test/test.php

Share/Bookmark:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Furl
  • StumbleUpon
  • Technorati
  • email
Similar posts:

Comments

14 Responses to “How to run PHP files on localhost?”
  1. Zohaib shah says:

    Bro i installed wamp & iis with php designer both of them didnot work so i search on google and i find ure article i m really thankfull for ure efforts and hardwork work Ranjith Keep it up dude,,,,

  2. Shekhar says:

    Thank you Ranjith
    it solved my problem

  3. shah zeb says:

    very well tutor about running files on xampp and wamp

  4. Kuntal Gupta says:

    Simple and Nice Tutorial :D

  5. php file run says:

    Plese send me ho to run php file in localhost
    I Don’t konw how to setting in localhost
    But this file i create and save in www folder and run with localhost in interbet explorer i get a error file not found plese send me detials

  6. Amol says:

    I have php designer, wamp server, iis. But could not able to open the php file in browser. The file couldnt run. how to run php file.
    Plz send me the exact soln and Correct procidure to follow.

  7. bahram says:

    it works perfectly…

  8. ash says:

    realy a good one thanks

  9. vikas says:

    it’s so nice.

  10. ajay says:

    its a nice suggestion but i installed wamp server … but it needs start first to execute the progarm ….. is this necessary for all server or it necessary only for wamp server

  11. Rahul says:

    Thanks for sharing. Can we install Xampp in D drive..as i dont have much space to store my PHP project files in my C drive.

  12. sathi says:

    How can i run mysql, please explain with an example

    Thanks

  13. Aditya says:

    sir ,i am doing a college project in which i have to create a image gallery where different user can share the images and also music …so do what other tools do i need apart from xampp to make both front end and back end(database)

  14. thanks for this short & easy tutorial
    i got what i was looking for

Leave a Reply