Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.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 HTTP 403_Php_Python_Wamp_Raspberry Pi - Fatal编程技术网

Php 禁止WampServer HTTP 403

Php 禁止WampServer HTTP 403,php,python,wamp,raspberry-pi,Php,Python,Wamp,Raspberry Pi,我正在做一个项目,这是一个传感器系统。传感器基于Raspberry Pi和基于PHP的web应用程序来收集和显示信息 我已经在笔记本电脑和学校的台式电脑上安装了Wamp服务器。我在运行Windows 8,而学校在运行Windows 7。就说我学校的网络是“SIT.edu” 我有一个WebS.php文件,我想让Raspberry Pi python脚本访问它。使用学校的台式计算机(IP地址如172.20.1.73),Raspberry Pi能够访问位于C:\wamp目录中的文件并运行一个函数 但是

我正在做一个项目,这是一个传感器系统。传感器基于Raspberry Pi和基于PHP的web应用程序来收集和显示信息

我已经在笔记本电脑和学校的台式电脑上安装了Wamp服务器。我在运行Windows 8,而学校在运行Windows 7。就说我学校的网络是“SIT.edu”

我有一个WebS.php文件,我想让Raspberry Pi python脚本访问它。使用学校的台式计算机(IP地址如172.20.1.73),Raspberry Pi能够访问位于C:\wamp目录中的文件并运行一个函数

但是,当我使用笔记本电脑通过局域网电缆连接到学校网络(SIT.edu),并向Raspberry Pi的python脚本提供IP地址(例如172.20.1.74)时,Raspberry Pi上的控制台会给出HTTP 403错误。我已尝试禁用防火墙,但没有效果。任何帮助都将不胜感激。谢谢大家!

检查您的Apache

编辑htpd.conf文件。在中,有一些语法告诉Apache允许从哪些位置(ip地址)接受连接

由于其设计为一个开发系统,默认情况下,此设置仅允许从运行WAMP(Apache)的PC进行访问,即localhost 127.0.0.1和maybe::1,具体取决于您使用的版本

因此,编辑httpd.conf文件(使用wampmanager菜单)

查找此部分

<Directory "c:/wamp/www/">
    #
    # 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 None

    #
    # 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 localhost
</Directory>
如果您使用的是Apache2.4,那么语法会发生变化,因此您应该使用

#   onlineoffline tag - don't remove
#   the equivalent of 127.0.0.1 localhost ::1
    Require local
#   allowing by IP
    Require ip 172.20.1.74
#   or for the whole subnet
    Require ip 172.20.1

请避免任何建议使用<代码>允许从所有< /代码>我确信学校不希望你在他们的网络上打开另一个攻击向量。< / P>可能是PI中的端口正在被另一个服务使用吗?请尝试使用其他端口号。@fp-Hi,指定路径时,没有为台式计算机或我的笔记本电脑指定端口号。它被指定为听起来像是权限问题。确保该文件对连接到服务器的用户具有正确的权限。它对我有效,谢谢
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 localhost ::1
    Allow from  172.20.1.74
# Or you could allow any ip on a subnet by using just the forst 3 quartiles
#   Allow from 172.20.1
#   onlineoffline tag - don't remove
#   the equivalent of 127.0.0.1 localhost ::1
    Require local
#   allowing by IP
    Require ip 172.20.1.74
#   or for the whole subnet
    Require ip 172.20.1