VirtualBox 和主机系统之间的 HTTP/MAMP 连接速度极慢

发布于 2024-12-27 16:27:00 字数 577 浏览 3 评论 0原文

我使用 MAMP Pro 在 Mac 上进行开发,并在 VirtualBox VM 中运行 Windows 7,以便可以在 Internet Explorer 中测试我的 WordPress 网站。问题是,当我尝试在虚拟机的浏览器中加载页面(http://10.0.2.2:8888)时,加载页面大约需要 30 秒。

大多数时间是 Firefox 中的“连接到...”和 IE 中的“等待...”,因此寻找主机系统似乎有很长的延迟。如果我将页面和/或浏览器重新加载到另一个页面,则每个页面都需要同样的时间。

如果我在主机系统上使用 Safari/Chrome/Firefox 访问 localhost:8888 它运行正常。如果我访问 VirtualBox 系统上的外部站点(包括外部服务器上同一网站的精确副本),它可以正常运行。仅当我尝试从虚拟机访问主机的 WordPress 站点时,才会出现长时间延迟。

主机:Mac OSX Snow Leopard、MAMP Pro (Apache),端口 8888 上运行 WordPress。

VM:使用 Firefox 9 和 Internet Explorer 9 访问 Windows 7。

有什么想法吗?

I develop on a Mac with MAMP Pro, and I am running Windows 7 in VirtualBox VM so I can test my WordPress sites in Internet Explorer. The problem is that when I try to load the page in a browser in the VM (http://10.0.2.2:8888) it takes about 30 seconds to load the page.

Most of that time is "Connecting to..." in Firefox and "Waiting for..." in IE, so it seems to be having a long delay finding the host system. If I reload the page and/or browser to another page, it takes just as long for every page.

If I use Safari/Chrome/Firefox on the host system to access localhost:8888 it runs fine. If I access outside sites on the VirtualBox system (including an exact copy of the same website on an outside server) it runs fine. The lengthy delay only occurs when I try to access the host's WordPress site from the VM.

Host: Mac OSX Snow Leopard, MAMP Pro (Apache) on port 8888 running WordPress.

VM: Windows 7 accessing with Firefox 9 and Internet Explorer 9.

Any ideas?

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

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

发布评论

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

评论(1

不甘平庸 2025-01-03 16:27:00

我发现了这个问题,但我想我应该把这个留在这里,以防其他人遇到同样的事情:

就我而言,问题是一个名为“cforms”的 WordPress 插件。该插件有一个错误,它尝试在没有正确端口的情况下加载 CSS 文件,因此它尝试加载 //domain/path/cforms.css 而不是 //domain:8888/path/cforms.css。 30 秒的延迟只是这些文件的浏览器超时。

在外部服务器上加载站点副本时并没有出现问题,因为它只是默认端口 80。我不确定为什么在加载 //localhost:8888 时站点仍然加载得很快,但这无关紧要。

I found the problem, but I thought I ought to leave this here in case others encounter the same thing:

In my case, the problem was a WordPress plugin called "cforms". The plugin has a bug where it tries to load its CSS files without the correct port, so it was trying to load //domain/path/cforms.css instead of //domain:8888/path/cforms.css. The 30 second delay was just the browser timeout for those files.

The problem didn't occur when loading the copy of the site on an outside server because it was just the default port 80. I'm not sure why the site still loaded quickly when loading //localhost:8888, but that's irrelevant.

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