> php教程 > php手册 > 본문

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

WBOY
풀어 주다: 2016-06-06 20:02:16
원래의
1758명이 탐색했습니다.

局域网之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 来访问本地电脑的项目了


관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!