问题
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 ??
回答1:
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.
回答2:
Should i use EasyPHP to install the application on my client's LAN server?
Yes. And those on the network would access the site just like you do from the local machine, except that they'll replace localhost
with that machine's IP address.
回答3:
You just need to install EasyPHP
and put your application in correct directory.
Alternatively for windows machine WAMP or XAMPP can be easy solution.
And for linux you can manually install everything or use XAMPP
.
These are just easy and straightforward to configure.
回答4:
Install the webserver and webapplication normally, other computers in your lan may access your webserver by simply accessing your network address (IP) normally something like 192.168.?.?
回答5:
yes you can deploy web application on LAN network by installing your web server in any PC connected to your lan after that you have to change some configuration in your web server to allow accessing it from any where even from outside throw the internet , and you can do some tricks like give it virtual host name as its normal web application , am sorry my English language is very bad .
来源:https://stackoverflow.com/questions/7213502/how-to-deploy-a-php-application-on-a-lan