How to deploy a PHP Application on a LAN?

Jignesh Manek picture Jignesh Manek · Aug 27, 2011 · Viewed 19k times · Source

I am a web designer and a PHP developer.

I have created some websites in PHP and deployed them to web servers from different vendors like GoDaddy, Yahoo, MediaTemple, etc.

But now, I am going to create an application that will be run on a LAN, so that from every computer on that LAN, the application can be available.

For development and testing, I use EasyPHP!

So my question is: should I use EasyPHP to install the application on my client's LAN server? If not, do you know any web tutorials which teach me how to deploy PHP web application on a LAN..?

can we create a separate windows installer in .net which install apache, PHP, MySQL as well as my application on PC ??

Answer

Ibrahim Azhar Armar picture Ibrahim Azhar Armar · Aug 27, 2011

When you install Apache or IIS or any other web server application, your computer acts as a web server. a webserver is not limited to local environment but it can respond to the request recieved from the internet too.

for example if you have installed Apache or IIS in your computer and you are connected to internet. then note down your IP address and switch to any other computer from outside and try accessing your computer and voila it accesses your files from within the web root directory as defined by your web server. your PC is now acting as a web server for the client. the same goes with LAN.

take for example there are 5 PC's connected to a WIFI router. the wifi will assign the local IP address to all the computer and hence

PC 1 have IP Address 192.168.1.2

PC 2 have IP Address 192.168.1.3

PC 3 have IP Address 192.168.1.4

PC 4 have IP Address 192.168.1.5

PC 5 have IP Address 192.168.1.6

now take for example you have installed Apache or IIS in PC 1 which have an IP address of 192.168.1.2, now all the other computer connected to netowrk will be able to access your web directory from the address 192.168.1.2. via a web browser. this will work regardless of what PHP application you are using. it is your Web server which is responsible for routing incoming request not your PHP application :)

hope this helps.