How to view PHP website on localhost
There are few ways to check your PHP website.1. Either on Localhost2. Directly on webhosting.Getting webhosting and trying it everytime is wastage of money if your website will take time.Thus we use localhost to view our website.
Things You'll Need
- Wamp Server
- Active Internet Connection
Download Wamp and install on your computer.Site: http://www.wampserver.com/en/
You have successfully install Wamp server and now ready for viewing of page on localhost.
Find the directory where Wamp server is installed.Mostly it will be in primary drive.for e.g: c:/wamp
Open WWW folder as shown in figure.
Copy all the files related to your PHP website in WWW folder to be viewed on loclhost.
Start your WAMP server.Goto: Start->ProgramFiles->Wamp Server-> Start Wampserver.A small telephone like icon will be shown in TaskBar as shown in figure.
Open your web browserType: http://localhostYou will localhost page by wampserver as shown in figure.
Click on your project and you will see the list of files in your folder.Open Index.htm or Index.php or your start page of your website.You will see this address in address barhttp://localhost/yourfolder/index.htm
You are all set to view your website without going online.
Tips & Warnings
- You need to make few changes in your code to make it work on localhost.
- Few changes in Sql connection string.