403 error on localhost with zend framework 2

我的未来我决定 提交于 2019-12-13 01:32:41

问题


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.

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.

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

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.

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>

Thanks again.

UPDATE 1

The error log is:

    [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/

回答1:


Solved it:

Inside the httpd.conf file, change

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

To:

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

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



来源:https://stackoverflow.com/questions/15458494/403-error-on-localhost-with-zend-framework-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!