28

I've got my Windows PC (localhost) running XAMPP. It loads the pages sometimes really quick or sometimes really slow.

So, I figured and searched and was recommended to get WAMP. I got that and installed it. Still, the pages load so damn slowly. No heavy CPU load or anything, all my ports are open too.

Any ideas?

orftz
  • 1,138
  • 13
  • 22

4 Answers4

81

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
orftz
  • 1,138
  • 13
  • 22
naitan
  • 1,137
  • 8
  • 7
  • 13
    I went through all of the options here. Non of them made any different - but once I have eddited my host - it WORKED! :D **Windows 7 & WAMP** issue solved. – Iladarsda Aug 13 '11 at 16:48
  • Yes, the host file editing worked great. – Codex73 Jan 11 '12 at 18:55
  • 1
    This appeared to work for me at first, but then it didn't. In my case, I found 5 or 6 Apache processes running in Task Manager. I killed them all and restarted Apache. Everything is fine now. – jedmao Dec 08 '12 at 20:47
  • 5
    For me, adding `127.0.0.1 127.0.0.1` to the list of hosts increased speed massively. Dropped pageloading time by 50%. Don't understand it, but thanks for the hint. – kaiser Aug 13 '13 at 11:11
  • Yes the host-file edit did it for me, too. This problem hasn't appeared with an older XAMPP installation. Why doesnt apachefriends.org fix this?? – AndiPower May 11 '14 at 22:41
  • Great, this worked for me on Win 7 64-bit! – designcise Oct 28 '14 at 04:54
  • Great. The only place I found the EnableMMAP details. That's what done it for me. – warmwhisky Oct 30 '20 at 12:22
11

Try to add this lines to hosts file:

127.0.0.1 127.0.0.1

127.0.0.1 localhost

and comment this line:

# ::1 localhost

You can find hosts file under: C:\Windows\System32\drivers\etc

Community
  • 1
  • 1
Aziz
  • 300
  • 1
  • 4
  • This is all that was needed to fix it for me, specifically commenting out the ::1 localhost line fixed it... Went from waiting a minute to instantaneous loading. – Andrew Mar 27 '14 at 18:02
2

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.

cwd
  • 53,018
  • 53
  • 161
  • 198
  • ^na that wasn't it, thank you though! –  May 10 '10 at 13:02
  • upvote for the coldfusion note. if you install cf, apache looks for the service (i don't know the technical details). if the service doesn't start up or is stopped, apache will hang for exactly 15 seconds, which is the timeout. i was trying to speed up my localhost by not running the cf service, but added 15 seconds to every request! aigh! i suppose i should also comment out the LoadModule for cf. – changokun Dec 12 '12 at 20:02
1

Oddly, the IP hosts/address change did the trick to me.

I'm on XP, and have had "127.0.0.1 localhost" in my hosts file forever.

Recently (maybe after some Windows updates, maybe after adding other application directories to my xampp htdocs, maybe after installing something else that conflicts with those ports?) pages - even simple HTML pages - started loading extremely slowly.

Merely commenting out the "127.0.0.1 localhost" line in my hosts file seems to have done the trick - now pages are loading consistently quickly.