首页 文章

在mac php中访问禁止的xampp

提问于
浏览
4

有错误信息:

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403

localhost
Apache/2.4.12 (Unix) OpenSSL/1.0.1m PHP/5.6.8 mod_perl/2.0.8-dev Perl/v5.16.3

我已将httpd.conf文件设置为以下内容:

Alias /myspace "/volumes/myspace/workspace/phpworkspace"
<Directory "/volumes/myspace/workspace/phpworkspace">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Deny,Allow
    Allow from all
    #Require all granted
</Directory>

“/ volumes / myspace / workspace / phpworkspace”这个地方是我的代码所在 . 我尝试了很多方法:

2 回答

  • 0

    Order 指令应首先是 Allow ,然后是 Deny .
    设置 Allow from all 并且不要为 Deny 设置任何内容 .

    将您的 Directory 指令更改为此指令,它应该可以正常工作

    <Directory "/volumes/myspace/workspace/phpworkspace">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order Allow,Deny
        Allow from all
        #Require all granted
    </Directory>
    
  • 0

    我已经解决了这个问题 .

    在文件“httpd.conf”中,还有另一个默认的目录配置,如下所示:

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

    您可以删除此目录或更改如下:

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

相关问题