WAMP/XAMPP 在本地主机上的响应非常慢 [英] WAMP/XAMPP is responding very slow over localhost
问题描述
我不知道是什么问题.WAMP 很慢,所以我重新格式化了我的电脑并安装了 WAMP.尽管如此,访问 localhost 还是非常非常慢,有时甚至根本无法加载.我什至删除了它并用 XAMPP 替换它,但我仍然得到相同的结果.可能是什么问题?这是我当前的主机文件:
127.0.0.1 本地主机127.0.0.1 本地主机
之前它运行良好,但我不知道发生了什么以及为什么它最近开始变得奇怪,因为即使重新格式化也无法解决它.
我在 64 位 Windows 8 上运行时遇到了同样的问题.Apache 真的很慢,但是当您多次按 F5 时就可以了.最后我做了很多事情后设法解决了它.现在它工作得很快.
尝试以下任务以提高性能:
更改apache的监听端口
将侦听端口从 80 更改为 8080,以避免与 Skype 等程序冲突.打开您的 httpd.conf 文件并找到以 Listen
开头的行(大约在第 62 行).像下面这样改变它:听127.0.0.1:8080
更改您的电源计划
将您的电源计划从平衡更改为高性能.您可以在 Control Panel\All Control Panel Items\Power Options
禁用 IPv6
这项特殊任务的功劳归于 了解更多信息.对我来说,这是真正正确完成工作的唯一解决方案.
祝你好运!
I don't know what the problem is. WAMP was very slow, so I reformatted my computer and installed WAMP. Still, accessing localhost is very, very slow, and sometimes it doesn't even load at all. I even removed it and replaced it with XAMPP, but I still got the same result. What might possibly be the problem? Here's my current hosts file:
127.0.0.1 localhost
127.0.0.1 localhost
It was perfectly working fine before, but I do not know what happened and why it has started acting strange lately, since even a reformat didn't fix it.
I had the same problem running on Windows 8 running on 64bit. Apache is really slow but when you press F5 many times it goes ok. In the end i after doing many things managed to solve it. Right now it works fast.
Try the following tasks to increase the performance:
Change apache's listening port
Change listening port from 80 to 8080 to avoid conflicts with programs like Skype. Open your httpd.conf file and find the line that starts with Listen
(it's around line 62). Change it like the following:
Listen 127.0.0.1:8080
Change your powerplan
Change your power plan from Balanced to High Performance. You can do this in Control Panel\All Control Panel Items\Power Options
Disable IPv6
The credits of this particular task go to Jef where he pointed this out in his blog post. From the Windows 8 desktop, press the Windows Key
and the R key
at the same time
Type regedit in the Run dialog box and click OK
Use Registry Editor to expand the registry tree and browse to:
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters
Right click on Parameters
, expand New
, and select DWORD (32-bit)
Value
Enter DisabledComponents
into the Name
field
Double click on the new DisabledComponents
value, enter ffffffff
into the Value data
dialog box, and click the OK
button
Confirm the new registry value contains the required data.
Change your etc/hosts
If you use virtual hosts don't add each virtual host on a new line. Instead list them like the following.
127.0.0.1 site-a site-b site-c
I also added 127.0.0.1 127.0.0.1
since I heard this somehow improves the lookup as well. (Can't confirm this but it can't hurt putting it there)
Your hosts file is located at C:\Windows\System32\Drivers\etc
Check how many apache processes are running
In my case I had two apache processes running. Be sure you only have one running. You can check this by pressing CTRL+ALT+DEL
and press Task Manager
Turn off the Base Filtering Engine (BFE)
What I find to be working a bit as well was turning off the Base Filtering Engine. Since stopping or disabling the BFE service will significantly reduce the security of the system you should only do this when needed.
Go to Control Panel => Administrative Tools => Services => Base Filtering Engine
Stop the Base Filtering Engine by clicking on Stop
Increase Apache's process priority
To to your task manager and change Apache's process priority from Normal to High by right clicking -> Set priority -> High
Keep Apache's process busy
This is a bit of an ugly method but it does certainly work. It keeps Apache busy and will process your own requests faster. Insert your local web-address in the iframe location and save it in a html file, run it and just leave it there until you're done.
<html>
<head>
<script>
setTimeout(function(){
window.location.reload(1);
}, 2000);
</script>
</head>
<body>
<iframe name="iframe" id="iframe" src="http://mywebsite:8080"></iframe>
</body>
</html>
Downgrade to Windows 7 Pro
As a Windows 8 Pro user you are entitled to have downgrade rights to Windows 7. Read here more about this. For me that was the only solution that really did the job properly.
Good luck!
这篇关于WAMP/XAMPP 在本地主机上的响应非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!