MAMP - 文档根目录无法正常工作它只显示我的其他项目之一,即使我将根目录更改为当前项目,它也只显示与以前相同的项目。无论我做什么,我都无法改变它,我重新安装了MAMP 4和MAMP 3.无论我做什么都有同样的问题?任何人都可以帮助!!
这不是DocumentRoot
发布它的Directory
问题,因为MAMP使用Apache 2.2.32
。 Apache2.2
和Apache2.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用户,那么使用XAMPP或WAMP。如果你是Mac用户,那么使用XAMPP。