当前位置:Gxlcms > 数据库问题 > 在Mac下配置php开发环境:Apache+php+MySql

在Mac下配置php开发环境:Apache+php+MySql

时间:2021-07-01 10:21:17 帮助过:3人阅读

Forbidden
You don‘t have permission to access /HelloMac.htm on this server.

OS X升级到Yosemite之后,自带的Apache也从2.2升级到了2.4,访问权限的配置上有所不同。

以配置alise别名目录为例,把/Users/redraiment/workspace/映射到http://localhost/workspace/,在2.2版本中配置信息如下:

<IfModule alias_module>
    Alias /workspace "/Users/redraiment/workspace/"
    <Directory "/Users/redraiment/workspace/">
        AllowOverride All
        Options Indexes MultiViews FollowSymLinks ExecCGI
        Order allow,deny
        Allow from all
        DirectoryIndex index.html index.php
    </Directory>
</IfModule>

升级到2.4版本之后:Order allow,denyAllow from all要改成Require all granted如下所示:

<IfModule alias_module>
    Alias /workspace "/Users/redraiment/workspace/"
    <Directory "/Users/redraiment/workspace/">
        AllowOverride All
        Options Indexes MultiViews FollowSymLinks ExecCGI
        Require all granted
        DirectoryIndex index.html index.php
    </Directory>
</IfModule>

 

在Mac下配置php开发环境:Apache+php+MySql

标签:

人气教程排行