Skip to main content

How to make a local web server on LAN

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:


Hopefully, you have now downloaded and installed Wampserver. This will give you a server on your own PC (Windows users), somewhere you can test your scripts. If you haven't yet dowloaded the Wampserver software, you can download it here: If the installation went well, you should have an new icon in the bottom right, where the clock is:
Click the icon to see the menu above.
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:
Click the link under Tools that says phpinfo(). If all went well, you should be looking at the following page (The one below is a different php version, but don't worry about this - as long as you see something):
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:
When you click on www directory, you should see an explorer window appear. This one is from Windows Vista: (You'll probably have only two files, index and testmysql.)
This www folder for Wampserver is usally at this location on your hard drive:
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

Popular posts from this blog

Open Source Softwares | World Wide Web is free of charge

Open-source software is computer software with its source code made available with a license in which the copyright holder provides the rights to study, change and distribute the software to anyone and for any purpose.   Open-source software is often developed in a public, collaborative manner. Open-source software is the most prominent example of open-source development and often compared to (technically defined) user-generated contentor (legally defined) open-content movements. A report by the Standish Group (from 2008) states that adoption of open-source software models has resulted in savings of about $60 billion per year to consumers. Some top Open-source software: Whatever you imagine in your mind, you will find it free of cost on web. Android: Android powers hundreds of millions of mobile devices in more than 190 countries around the world. It’s the largest installed base of any mobile platform and growing fast—every day another million users power up t

Whatsapp Vs Telegram

WhatsApp and Telegram are the two leading messaging applications today. Telegram is the most recent, though less popular and has emerged to give some little competition to WhatsApp’s 450 million user base. With the recent takeover of WhatsApp by Facebook , Telegram may just have gotten the break it needs. But what makes one better than the other? Similarities: Both use the same identification formula (mobile number) and are very similar in the user interface, even the conversation view. You can still chat on groups; send pictures on videos on Telegram too. Differences: WhatsApp is relatively slow compared to Telegram. With telegram, instances of hanging are less and it is lighter on the phone RAM. You can install Telegram on multiple devices using one number and use them all concurrently while WhatsApp only allows use of one number per device. While WhatsApp requires an Android emulator for use on PC, Telegram has an app for easy use on your computer. Mobile