MAMP - 文档根目录无法正常工作

问题描述 投票:0回答:1

MAMP - 文档根目录无法正常工作它只显示我的其他项目之一,即使我将根目录更改为当前项目,它也只显示与以前相同的项目。无论我做什么,我都无法改变它,我重新安装了MAMP 4和MAMP 3.无论我做什么都有同样的问题?任何人都可以帮助!!

apache mamp
1个回答
0
投票

这不是DocumentRoot发布它的Directory问题,因为MAMP使用Apache 2.2.32Apache2.2Apache2.4是不同的Vhost格式。 MAMP版本history

Apache 2.2 Vhost格式:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/Applications/MAMP/Library/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

Apache 2.4 Vhost格式:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/Applications/MAMP/Library/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    <Directory "/Applications/MAMP/Library/docs/dummy-host2.example.com">
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

Apache Vhost format reference

如果您使用MAMP,您的问题将无法解决。试试Apache 2.4。如果你是Windows用户,那么使用XAMPPWAMP。如果你是Mac用户,那么使用XAMPP

© www.soinside.com 2019 - 2024. All rights reserved.