Zend Framework 2在localhost上出现403错误 [英] 403 error on localhost with zend framework 2

查看:44
本文介绍了Zend Framework 2在localhost上出现403错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以在尝试加载此代码时遇到了403错误-我什至通过youtube指导安装了Zend 2,幸运的是它可以直接使用.

Ok, so I've been getting the 403 error when trying to load this up - I installed Zend 2 even via youtube guidance of someone fortunate that it's works for out of the box.

我遵循了建议,但这没有用,因为LoadModule rewrite_module modules/mod_rewrite.so不是' t从我的httpd.conf文件中删除了注释.

I followed this advice, but that didn't work because LoadModule rewrite_module modules/mod_rewrite.so wasn't commented out of my httpd.conf file.

我尝试了,但是将Options +Indexes +FollowSymLinks +ExecCGI添加到我的vhosts.conf文件中没有帮助.

I tried this, but adding Options +Indexes +FollowSymLinks +ExecCGI to my vhosts.conf file didn't help.

我尝试完全删除.htaccess文件. 我尝试注释掉httpd-xampp.conf文件的"XAMPP安全概念"部分. 我试着很好地询问这个问题,并尝试大喊大叫,因为这两种策略都徒劳无功.

I tried removing the .htaccess file altogether. I tried commenting out the "XAMPP Security Concept" section of the httpd-xampp.conf file. I tried asking it very nicely, and I tried shouted expletives at it - both strategies proved fruitless.

我正在运行Windows 8,但似乎无法弄清为什么出现权限错误.为了清楚起见,每次更改后,我都会重新启动Apache.当我从vhosts.conf文件中删除条目时,403消失了,但这在该目录中导致了404.我已经包含了vhosts.conf文件中的相关代码.感谢您的帮助!

I'm running Windows 8 and I can't seem to figure out why I am having permission errors. Just to be clear, I am restarted Apache after every change. When I remove the entries from the vhosts.conf file, the 403 is gone, but that causes a 404 in that directory. I've included the relevant code from the vhosts.conf file. Thanks for any help!

    NameVirtualHost *:80

    <VirtualHost *:80>
        ServerName zf2.localhost
        DocumentRoot "C:/Users/Captain/Documents/zf2/public"
        SetEnv APPLICATION_ENV "development"
        <Directory C:/Users/Captain/Documents/zf2/public>
        Options +Indexes +FollowSymLinks +ExecCGI
            DirectoryIndex index.php
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>

再次感谢.

更新1

错误日志为:

    [Sun Mar 17 03:35:32.627159 2013] [authz_core:error] [pid 5492:tid 1764] [client ::1:50566] AH01630: client denied by server configuration: C:/Users/Captain/Documents/zf2/public/

推荐答案

已解决:

httpd.conf文件中,更改

    <Directory />
        AllowOverride none
        Require all denied
    </Directory>

收件人:

    <Directory />
        AllowOverride none
        Require all granted
    </Directory>

这对我有用,我现在可以访问localhost和所有目录项目.

That worked for me, and I can access localhost and all directory projects now.

这篇关于Zend Framework 2在localhost上出现403错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆