使用 mamp 通过 LAN 访问 phpmyadmin

发布于 2024-09-27 09:28:16 字数 478 浏览 4 评论 0原文

我们正在尝试设置 Mamp Pro 安装(在 Mac 上),它允许我们通过 LAN 访问 PhPmyAdmin。我们可以使用标准共享访问 htdocs 文件夹来编辑其内容,因此这不是问题。

问题是我们似乎无法访问此安装的 PhPmyAdmin。我已经在谷歌上搜索了几个小时,试图让这项工作成功,现在我在这里尝试。

我发现了几个案例,他们解释说您可以通过以下方式访问 phpMyAdmin:

http://ip-ofserver:8888/MAMP

但这不起作用,我收到此错误:

Forbidden 您无权访问此服务器上的 /MAMP。

访问服务器内容本身正常。我得到了 mamp pro 全新安装提供的测试网页。

设置

互联网 -> Airport Extreme 提供 LAN

3 主机连接到 LAN 一台是装有 Lamp 的 mac mini。

We are trying to set up a Mamp Pro installation ( on Mac ) which allows us to access PhPmyAdmin over the lan. We can access the htdocs folder to edit it's contents using standard sharing so that is not a problem.

The problem is that we can't seem to the access the PhPmyAdmin of this installation. I've googled for several hours trying to make this work and now I'm trying here.

I found several cases where they explain that you can access your phpMyAdmin via this:

http://ip-ofserver:8888/MAMP

but this is not working and I get this error:

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

Accessing the servers content itself is working. I'm getting the test webpage provided with the clean installation of mamp pro.

Setup

Internet -> Airport Extreme provides LAN

3 hosts are connected to the Lan
and one is a mac mini with the Lamp installation on it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤星 2024-10-04 09:28:16

我没有找到正确的答案,但我找到了解决方法,只需复制 MAMP/bin/phpMyAdmin
目录到 MAMP/htdocs/ 下

重命名该文件夹,在我的例子中我有 MAMP/htdocs/dba
然后你只需执行以下操作:
http://(dev-machine-ip)/dba

替换 (dev-machine-ip)与安装了 MAMP 的开发机器的 IP。
更改文件夹名称的原因是因为 httpd.conf 中有一个配置将 /phpMyAdmin 重定向到不同的物理文件夹。当然,您也可以删除该指令,具体取决于您。

I didn't find the correct answer, but I found a work around, just copy MAMP/bin/phpMyAdmin
directory to under MAMP/htdocs/

Rename the folder, in my case I have it MAMP/htdocs/dba
Then you simply do:
http://(dev-machine-ip)/dba

Replace (dev-machine-ip) with the IP of your dev machine where MAMP is installed.
The reason to change the folder name is because there is a configuration in httpd.conf that redirect /phpMyAdmin to a different physical folder. Of course you can also just remove that directive, up to you.

傾旎 2024-10-04 09:28:16

我通过将本地 IP 范围地址添加到 http.conf 文件,成功地使用 MAMP Pro 解决了这个问题。

我通过(从 MAMP Pro 窗口)file > 完成此操作编辑模板>阿帕奇> http.conf 滚动到第 399 行,有文本块

    Alias /phpMyAdmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"
    Alias /phpmyadmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"

    <Directory "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin">
        Options Indexes
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from localhost
        Allow from 127.0.0.1
        Allow from ::1
    </Directory>

并进行编辑以允许我的本地 IP(即 192.168.2.xxx)

    Alias /phpMyAdmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"
    Alias /phpmyadmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"

    <Directory "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin">
        Options Indexes
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from localhost
        Allow from 127.0.0.1
        Allow from ::1
#Adding in new rule to allow local IPs to access, leave the last number blank to allow all in that range
        Allow from 192.168.2
    </Directory>

重新启动服务器并能够从我们网络上的另一台计算机访问 phpmyadmin输入http://[HostComputerIP]:8888/phpMyAdmin

I have managed to solve this problem with MAMP Pro by adding my local ip range address to the http.conf file.

i complete this by going to (from MAMP Pro window) file > Edit Template > Apache > http.conf scrolling to about line 399 there was the block of text

    Alias /phpMyAdmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"
    Alias /phpmyadmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"

    <Directory "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin">
        Options Indexes
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from localhost
        Allow from 127.0.0.1
        Allow from ::1
    </Directory>

and editing to to allow my local IP (which is 192.168.2.xxx)

    Alias /phpMyAdmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"
    Alias /phpmyadmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"

    <Directory "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin">
        Options Indexes
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from localhost
        Allow from 127.0.0.1
        Allow from ::1
#Adding in new rule to allow local IPs to access, leave the last number blank to allow all in that range
        Allow from 192.168.2
    </Directory>

Restarted the server and was able to access phpmyadmin from another computer on our network by entering http://[HostComputerIP]:8888/phpMyAdmin

嗳卜坏 2024-10-04 09:28:16

我遇到了这个问题,结果发现它是为另一个应用程序安装的 .htaccess 文件,该应用程序也应用于 phpMyAdmin。

.htaccess 文件保存其所在特定文件夹以及该文件夹内所有子文件夹的 apache 指令。这些指令与通常存在于 /etc/apache2/httpd.conf 文件中的指令相同,只是它们是针对特定的 Web 文件目录而挑选出来的。

解决方案: 1、使用BBedit编辑/etc/apache2/httpd.conf文件。将 AllowOverride All 更改为 AllowOverride None。但是,这将导致 Apache 忽略所有 .htaccess 文件。 2. 使用 /etc/apache2/httpd.conf 中创建一个部分,并将所有指令从有问题的 .htaccess 移至该部分。使用 指定指令应用于哪个目录。然后删除 .htaccess 文件。 3. 如果可以的话,将有问题的 .htaccess 文件在文件结构中向下移动到实际需要的位置。

请注意,.htaccess 是 Mac 上的隐藏文件。查找哪些工具可以使隐藏文件可见,以便您可以处理它们,例如 BBedit 和 Pref Pane Secrets。

I had this problem and it turned out to be a .htaccess file installed for another application that was being applied to phpMyAdmin too.

.htaccess files hold apache directives for the specific folder where it lives and all sub folders within that folder. These directives are the same ones that normally would live in the /etc/apache2/httpd.conf file except for the fact that they are being singled out for a specific directory of web files.

Solutions: 1. Use BBedit to edit the /etc/apache2/httpd.conf file. Change AllowOverride All to AllowOverride None. However, this will cause Apache to ignore all .htaccess files. 2. Create a section in /etc/apache2/httpd.conf using <Directory … > and move all the directives from the offending .htaccess to that section. Use <Directory> to be specific which Directory the directives are applied to. Then erase the .htaccess file. 3. If you can, move the offending .htaccess file down the file structure to where it's actually needed.

Note that .htaccess is a hidden file on the Mac. Look up what tools are available to make hidden files visible so you can work on them, like BBedit and the Pref Pane Secrets.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文