【问题标题】:MAMP installed and htdocs is set as localhost but can't see folder within localhost已安装 MAMP 并将 htdocs 设置为 localhost 但在 localhost 中看不到文件夹
【发布时间】:2017-12-03 23:36:45
【问题描述】:

我已经在我的 Windows 7 笔记本电脑上设置了 MAMP,并将 localhost 设置为 htdocs 文件夹。 在我在这个文件中命名了数据库、用户名和密码之后,我创建了一个数据库并将 wp-config_sample.php 重命名为 wp-config。

appache 服务器和 MYSQL 服务器已开启。 如果我在 Chrome 浏览器中输入 localhost/,则会显示以下内容:

index of/
test.php

但 htdocs 中名为 testsite 的 wordpress 文件夹不可见 如果我在浏览器中输入 localhost/MAMP/,则 MAMP 页面会正确显示。 如果我输入 localhost:3306/testsite 会显示以下内容:

This page isn’t working
localhost sent an invalid response.
ERR_INVALID_HTTP_RESPONSE

MySQL 端口已更改为免费的 3306

如果我输入 localhost/testsite 会显示以下内容:

Forbidden
You don't have permission to access /testsite/ on this server.

请让我知道我需要在这篇文章中添加哪些其他信息。谢谢

【问题讨论】:

    标签: php mysql wordpress localhost mamp


    【解决方案1】:

    需要设置文件夹权限才能在localhost中查看文件夹

    运行命令chmod *** /folder更改权限

    @更新:

    那么你应该尝试在 Mamp 的 host file.conf 中添加这样的行

    Alias /mytest/ "C:/mytest/" 
    
    <Directory "C:/mytest/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
            Order allow,deny
        Allow from all
        Require local
    </Directory>
    

    【讨论】:

    • 我使用的是 windows,当我查看文件夹的属性时,管理员和非管理员都可以完全控制文件夹 testsite 及其子文件夹
    • 请尝试以上解决方案
    • 抱歉,我很难找到主机 file.conf。
    • C:\MAMP\conf\apache\httpd.conf
    • 我在主机文件中添加了将 C:/mytest/ 替换为 C:/MAMP/testsite 的行,但仍然收到与上述相同的错误消息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-13
    • 1970-01-01
    • 2012-12-01
    • 1970-01-01
    • 2014-06-09
    相关资源
    最近更新 更多