局域网之php项目IP访问共享

局域网之php本地项目共享


该文章主要介绍本地php项目在局域网内的共享访问,主要体现为通过本地ip地址访问项目


做法如下:

1.更改本地盘host文件(winds目录为:C:\Windows\System32\drivers\etc),配置: 127.0.0.1 -> 192.168.184.111;指向电脑目前的ip地址

(一般第一步搞定,关了防火墙就会成功的。这是做java开发中Tomcat上实验成功过的)。

2.更新Apache文件httpd.conf(目录为:apache\Apache2.2.17\conf),允许项目根目录被访问,找到:

 

[html] view plain copy 在CODE上查看代码片派生到我的代码片
  1. <Directory "D:/wamp/www/">  
  2.     #  
  3.     # Possible values for the Options directive are "None", "All",  
  4.     # or any combination of:  
  5.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews  
  6.     #  
  7.     # Note that "MultiViews" must be named *explicitly* --- "Options All"  
  8.     # doesn't give it to you.  
  9.     #  
  10.     # The Options directive is both complicated and important.  Please see  
  11.     # http://httpd.apache.org/docs/2.2/mod/core.html#options  
  12.     # for more information.  
  13.     #  
  14.     Options Indexes FollowSymLinks  
  15.   
  16.     #  
  17.     # AllowOverride controls what directives may be placed in .htaccess files.  
  18.     # It can be "All", "None", or any combination of the keywords:  
  19.     #   Options FileInfo AuthConfig Limit  
  20.     #  
  21.     AllowOverride all  
  22.   
  23.     #  
  24.     # Controls who can get stuff from this server.  
  25.     #  
  26.   
  27. #   onlineoffline tag - don't remove  
  28.     Order Deny,Allow  
  29.     Deny from all  
  30.     Allow from 127.0.0.1  
  31.   
  32. </Directory>  

 

把 Allow from 127.0.0.1 改为Allow from  all ;意思是允许所有来源的访问


3.重启Apache,局域网内其他电脑便可以通过 192.168.184.111 来访问本地电脑的项目了

转载:

Sara的专栏 http://blog.csdn.net/haiqiao_2010/article/details/36627481

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值