This post is great for web developers and web designers, who needs real-time testing of web-based applications or themes for WordPress, Joomla, Drupal and other web applications without a need of internet connection or web hosting. It should also cover and beware of all most important mistakes and unexpected errors, which sometimes happen and which other posts do not cover. So users who will follow this post step by step, should have working localhost web server in 90%, without any unexpected errors. I decided to write this post, because I followed many posts on the web, but I was not able to get all work for the first time, so I spent many hours of searching and fixing unexpected errors, which are all covered in this post.
Install Wamp Server:
From here, you can stop the server, exit it, view help files, and see the configuration pages.
Click on localhost, though, and you'll see this page appear:
If you saw the above page, then congratulations! Your PHP server is up and running, and you can make a start scripting PHP pages.
Troubleshooting
If you don't see the info.php page, then you will need to refer to the wampserver forums. The page you need is here:Hopefully, your question will already have been asked an answered. (Unfortunately, we can't answer questions about Wampserver, as it's not our software.)
Saving your PHP files
Whenever you create a new PHP page, you need to save it in your WWW directory. You can see where this is by clicking its item on the menu:
c:/wamp/www/
Bear this in mind when you click File > Save As to save your PHP scripts.Launching your PHP scripts
Suppose you have created a php script called test1.php. To launch this script, you need to add the script name after localhost in your browser. So instead of this:
http://localhost/index.php
You would type this:
http://localhost/test1.php
You don't type the name of the wamp folder, however. This would be wrong, for example:
c:/wamp/www/test1.php
As too would this:
http://localhost/www/test1.php
Your server knows where the www folder is, so you don't have to type it out: just add the script name to localhost. Likewise, if you create a folder under www then you'd just type this:
http://localhost/folder_name/script_name.php
OK, we'll assume that everything is now up and running. If it's not, click "Move on to the Next Part" below, for some troubleshooting. If it is, click "Back to the PHP Contents Page".
Access from other computers in the network:
Run 'ipconfig' command in the windows. Get your local ip address in the form of IPv4. Type this ip in browser's address bar. just like:
http://192.168.0.2
Comments
Post a Comment