如何在局域网上部署PHP应用程序? [英] How to deploy a PHP Application on a LAN?

查看:414
本文介绍了如何在局域网上部署PHP应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名网页设计师和一名PHP开发人员.

I am a web designer and a PHP developer.

我已经用PHP创建了一些网站,并将其部署到来自GoDaddy,Yahoo,MediaTemple等不同供应商的Web服务器上.

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

但是现在,我将创建一个将在LAN上运行的应用程序,以便该LAN上的每台计算机都可以使用该应用程序.

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.

对于开发和测试,我使用 EasyPHP

For development and testing, I use EasyPHP!

所以我的问题是:我应该使用EasyPHP在客户端的LAN服务器上安装该应用程序吗?如果没有,您是否知道任何Web教程,它们可以教我如何在LAN上部署PHP Web应用程序.?

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..?

我们可以在.net中创建一个单独的Windows安装程序,以在PC上安装apache,PHP,MySQL以及我的应用程序吗?

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

推荐答案

在安装Apache或IIS或任何其他Web服务器应用程序时,您的计算机将充当Web服务器. Web服务器不仅限于本地环境,它还可以响应从Internet收到的请求.

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.

例如,如果您已经在计算机中安装了Apache或IIS,并且已连接到Internet.然后记下您的IP地址,并从外部切换到其他任何计算机,然后尝试访问您的计算机,然后瞧,它会从Web服务器定义的Web根目录内访问您的文件.您的PC现在充当客户端的Web服务器.局域网也是如此.

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.

例如,有5台PC连接到WIFI路由器. wifi会将本地IP地址分配给所有计算机,因此

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的IP地址为192.168.1.2

PC 1 have IP Address 192.168.1.2

PC 2的IP地址为192.168.1.3

PC 2 have IP Address 192.168.1.3

PC 3的IP地址为192.168.1.4

PC 3 have IP Address 192.168.1.4

PC 4的IP地址为192.168.1.5

PC 4 have IP Address 192.168.1.5

PC 5的IP地址为192.168.1.6

PC 5 have IP Address 192.168.1.6

现在以您在PC 1中安装的Apache或IIS为例,它们的IP地址为192.168.1.2,现在连接到netowrk的所有其他计算机都可以从地址192.168.1.2访问您的Web目录.通过网络浏览器.无论您使用什么PHP应用程序,它都将起作用.是您的Web服务器负责路由传入的请求,而不是您的PHP应用程序:)

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 :)

希望这会有所帮助.

这篇关于如何在局域网上部署PHP应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆