我有运行 XAMPP 的 Windows PC (localhost)。它加载页面有时非常快或有时非常慢。
所以,我想通了,搜索了一下,被推荐去 WAMP。我得到了它并安装了它。尽管如此,页面加载如此缓慢。没有繁重的 CPU 负载或任何东西,我所有的端口也都打开了。
有任何想法吗?
我有运行 XAMPP 的 Windows PC (localhost)。它加载页面有时非常快或有时非常慢。
所以,我想通了,搜索了一下,被推荐去 WAMP。我得到了它并安装了它。尽管如此,页面加载如此缓慢。没有繁重的 CPU 负载或任何东西,我所有的端口也都打开了。
有任何想法吗?
Here's a solution that really worked for me.
One thing to try is changing the following two entries in apache/conf/httpd.conf
from OFF
to ON
:
EnableMMAP on
EnableSendfile on
Also, enable and set realpath_cache_size= 4m
to your php.ini
file.
If your are using InnoDB database also enable and set in my.ini
:
innodb_flush_log_at_trx_commit = 2
Finally, it seems it worked for some people: edit your host (C:\Windows\System32\drivers\etc\hosts
) by adding
127.0.0.1 localhost
127.0.0.1 127.0.0.1
And commenting:
\# ::1 localhost
尝试将此行添加到主机文件:
127.0.0.1 127.0.0.1
127.0.0.1 本地主机
并评论这一行:
# ::1 本地主机
您可以在以下位置找到主机文件: C:\Windows\System32\drivers\etc
Very slow is a very general problem, but it happened for me when I first installed IIS to run alongside apache, and also after I did a windows update (config was reset?)
Anyhow, what happened was that IIS started conflicting with Apache on port 443 (SSL) and so I had to use the follow command to disable SSL on IIS so that Apache would run fast again:
c:\inetpub\adminscripts\>adsutil set w3svc/1/securebindings "::"
Hope this helps.
edit: I also found that if I had ColdFusion installed and the service timed out during startup apache would run really slow. If you have ColdFusion installed, run services.msc and check to see if the main service is running. If that works, try adjusting your startup time ( http://www.ahphosting.net/support/Customer/KBArticle.aspx?articleid=23 ) so it will start automatically on the next reboot.
奇怪的是,IP 主机/地址更改对我有用。
我在 XP 上,并且在我的主机文件中永远有“127.0.0.1 localhost”。
最近(可能是在一些 Windows 更新之后,可能是在将其他应用程序目录添加到我的 xampp htdocs 之后,可能是在安装了与这些端口冲突的其他东西之后?)页面 - 甚至是简单的 HTML 页面 - 开始加载非常缓慢。
仅在我的主机文件中注释掉“127.0.0.1 localhost”行似乎就可以解决问题 - 现在页面加载速度很快。