Heim  >  Artikel  >  php教程  >  局域网之php项目IP访问共享

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

WBOY
WBOYOriginal
2016-06-06 20:02:161760Durchsuche

局域网之php本地项目共享 该文章主要介绍本地php项目在局域网内的共享访问,主要体现为通过本地ip地址访问项目 做法如下: 1.更改本地盘host文件(winds目录为:C:\Windows\System32\drivers\etc),配置:127.0.0.1192.168.184.111;指向电脑目前的ip地址 2.更新Apa

局域网之php本地项目共享


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


做法如下:

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


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

<directory>
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1

</directory>

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


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


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:PHP 设计模式(二)Nächster Artikel:php常见的面试题目