Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php WampServer v2.5联机403错误禁止_Php_Mysql_Apache_Wampserver - Fatal编程技术网

Php WampServer v2.5联机403错误禁止

Php WampServer v2.5联机403错误禁止,php,mysql,apache,wampserver,Php,Mysql,Apache,Wampserver,我下载了wampserver来创建我们的php应用程序,我已经在我的主机文件中设置了我的域thesis.dev。我的团队成员正在我们的项目中工作,我们共享来自调制解调器路由器的wifi。我正在尝试将我们的项目放在网上,以便他们也可以访问我的项目以查看创建的网站,但我的朋友得到了以下信息: 403禁止的错误消息 这是我的主机文件: # Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Mi

我下载了wampserver来创建我们的php应用程序,我已经在我的主机文件中设置了我的域
thesis.dev
。我的团队成员正在我们的项目中工作,我们共享来自调制解调器路由器的wifi。我正在尝试将我们的项目放在网上,以便他们也可以访问我的项目以查看创建的网站,但我的朋友得到了以下信息:

403禁止的错误消息

这是我的主机文件:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost

127.0.0.1       localhost
127.0.0.1       project.dev

::1             localhost
::1             project.dev
这是我的httpd-vhosts.conf文件:

# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "c:\wamp\www"
    ServerName  localhost
    ServerAlias localhost

    <Directory c:\wamp\www>
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "d:\Documents\Programs\Websites\thesis\public"
    ServerName  thesis.dev
    ServerAlias thesis.dev

    <Directory d:\Documents\Programs\Websites>
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>
#虚拟主机
#
#所需模块:mod_log_config
#如果要在服务器上维护多个域/主机名
#您可以为它们设置VirtualHost容器。大多数配置
#只使用基于名称的虚拟主机,这样服务器就不需要担心
#IP地址。这由以下指令中的星号表示。
#
#请参阅
# 
#在尝试设置虚拟主机之前,请参阅详细信息。
#
#您可以使用命令行选项'-S'来验证虚拟主机
#配置。
#
#虚拟主机示例:
#几乎所有Apache指令都可以放入VirtualHost容器中。
#第一个VirtualHost部分用于所有不需要的请求
#在任何块中匹配ServerName或ServerAlias。
#
服务器管理员webmaster@dummy-host.example.com
DocumentRoot“c:/Apache24/docs/dummy host.example.com”
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog“logs/dummy host.example.com error.log”
CustomLog“logs/dummy host.example.com access.log”通用
服务器管理员webmaster@dummy-host2.example.com
DocumentRoot“c:/Apache24/docs/dummy-host2.example.com”
ServerName dummy-host2.example.com
ErrorLog“logs/dummy-host2.example.com error.log”
CustomLog“logs/dummy-host2.example.com access.log”通用
DocumentRoot“c:\wamp\www”
服务器名本地主机
服务器别名本地主机
允许超越所有
要求本地
DocumentRoot“d:\Documents\Programs\Websites\thesis\public”
ServerName.dev
ServerAlias.dev
允许超越所有
要求本地
我的Apache版本:2.4.9。我的MySQL版本:5.6.17。我的PHP版本:5.5.12

我的IP地址是192.168.1.2

我的朋友们试图在浏览器上访问192.168.1.2,但出现403错误。

确定一些问题

首先从httpd-vhost.conf文件中删除这两个条目。它们只是帮助人们入门的示例条目。如果您注意到它们指向您实际上不应该拥有的文件夹,即
C:/Apache24

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
注:我添加了这一行

Require ip 192.168.1
IPv4 Address. . . . . . . . . . . : 192.168.1.11
例如,您所需要做的就是检查您的路由器DHCP服务器是否在子网192.168.1中提供ip地址这是家庭路由器的标准,但您的可能不同

通过从命令行运行此命令来检查您的

ipconfig
然后检查这条线

Require ip 192.168.1
IPv4 Address. . . . . . . . . . . : 192.168.1.11

并使用4个四分位数中的前3个四分位数允许使用您的内部网络的任何人访问网站。

403表示您正在访问您无权访问的资源。你的错误日志是怎么说的?这是(如果可以的话,请尽量避免使用外部粘贴板,并对你的帖子进行更改,而不仅仅是在评论中。如果帖子隐藏在断开的链接中,未来的访问者可能无法关注帖子的详细信息)。好的,关于不存在域名的警告值得修复。将
ServerName
更改为您希望使用的域字符串,或将其删除。