WAMP/XAMPP is responding very slow over localhost

294,968

Solution 1

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

enter image description here

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

enter image description here

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

enter image description here

Type regedit in the Run dialog box and click OK

enter image description here

Use Registry Editor to expand the registry tree and browse to:

\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters

enter image description here

Right click on Parameters, expand New, and select DWORD (32-bit) Value

enter image description here

Enter DisabledComponents into the Name field

enter image description here

Double click on the new DisabledComponents value, enter ffffffff into the Value data dialog box, and click the OK button

enter image description here

Confirm the new registry value contains the required data.

enter image description here

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)

enter image description here

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

enter image description here

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

enter image description here

Stop the Base Filtering Engine by clicking on Stop

enter image description here

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 enter image description here

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!

Solution 2

This is caused by IPV6. Here is how you make MYSQL not use it. (so, without disabling IPV6)

edit mysql file 'my.ini'

under [wampmysqld] or [mysqld] add the following:

bind-address = ::

Save file and restart mysql service

enjoy!

Solution 3

have a look here :

http://forum.wampserver.com/read.php?2,91602,page=3

Basically use 127.0.0.1 instead of localhost when connecting to mysql through php on windows 8

if your finding phpmyadmin slow

in the config.inc.php you can change localhost to 127.0.0.1 also

Solution 4

The solution that worked for me was to disable the cgi_module. Use one of these methods:

(Method 1) Right click on WAMP > Apache > Apache Modules > uncheck "cgi_module"

(Method 2) Edit httpd.conf and disable the loading of the CGI module by commenting this line:

LoadModule cgi_module modules/mod_cgi.so

Commenting would be just adding a # in front, like this:

#LoadModule cgi_module modules/mod_cgi.so

Restart the Apache service and you should be good to go.

Solution 5

In my case, load time is 5 times faster when this is disabled in php.ini :

;zend_extension = "\xampp\php\ext\php_xdebug-2.1.0-5.3-vc6.dll"
Share:
294,968
FBwall
Author by

FBwall

Updated on January 16, 2021

Comments

  • FBwall
    FBwall over 3 years

    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.

  • wowpatrick
    wowpatrick over 11 years
    That speed up the request time by about 80%. Why is PHP so slow to connect to MySQL with localhost under Windows 8?
  • AgelessEssence
    AgelessEssence almost 11 years
    this is a good collection of answers, the only thing i did and work for me was disabling IPv6, thats all, so thanks ;)
  • Benno
    Benno over 10 years
    This didn't fix it for me :( I know it fixed once in the past, but for some reason it isn't working now, sadpanda.
  • Synetech
    Synetech over 10 years
    I also added 127.0.0.1 127.0.0.1 That’s not even valid syntax for a HOSTS file; you cannot remap an IP address. Check how many apache processes are running. In my case I had two apache processes running. Be sure you only have one running. What‽ You’re supposed to have two instances of httpd.exe; that’s expected and normal. The second one is the worker which does the main work, and the first is just the monitor which can restart the worker if it crashes. You only get one in debug mode which is not meant for regular use.
  • bicycle
    bicycle over 10 years
    All these things may be not valid, regular, etc but at least it makes apache go faster. That you have to wait ten seconds to load a page is also not expected but is regular in Windows systems. In the end it may be better to switch to Mac or Ubuntu if you don't mind the bugs within the system.
  • Martin Asenov
    Martin Asenov over 10 years
    Very nice, thorough comment, but with little downside for me... instead of putting Apache on port 8080, we'd better disallow Skype to use ports 80 and 443. It is done in Skype's connection settings. Pointing to 8080 is not a good practice from a developer's point of view, basically because it may conflict with Apache Tomcat that runs on default on 8080, and is also included in the XAMPP package.
  • BrownChiLD
    BrownChiLD over 9 years
    Just wanted to give my big thanks to this answer.. this helped me speed up my queries!
  • Pascalculator
    Pascalculator over 9 years
    I've been looking for the cause of this for more than a year now. For me, this was the main and sole culprit. Here's a post that describes what you can do besides having to disable Xdebug: stackoverflow.com/questions/24893010/… Thanks!
  • Pavel V.
    Pavel V. over 9 years
    @MartinAsenov: if it's only Skype, that's fine, Skype can be easily redirected to another port. But I have port 80 issues with few other programs like Dropbox, which is not so easy to move to another port.
  • Ejaz
    Ejaz over 9 years
    It reduced the response time to 20% on windows 8.1. Thanks for the answer. Same question as wowpartick's
  • hbit
    hbit about 9 years
    Thanks, thanks, thanks, thanks!!! I have been trying everything that is writte up here and elsewhere. And XDEBUG was that thing that made phpMyAdmin slow as hell. And now it flyes again!
  • Martyn Shutt
    Martyn Shutt about 9 years
    Exact same problem, even with a newer copy of the extension. Just quicker for me to comment it out when not needed, but probably related to one of the other .ini settings with the extension.
  • AndiPower
    AndiPower almost 9 years
    Perfect! I gave your answer a 5% chance that it would help, but it really did! thanks.
  • user2345998
    user2345998 almost 9 years
    Great - it reduced the request time from 1,03 sec. to ~15ms. Thanks! (Using win8.1 64bit)
  • user2345998
    user2345998 almost 9 years
    I suggest to put Stephan's apprach (change localhost to 127.0.0.1) at the top of the list, since this seems to be the reason very often and is quite easy to test.
  • Sabeer
    Sabeer almost 9 years
    Thanks man Speed improved a lot... As I am using XAMPP I have added it under [mysqld]
  • Aldry Wijaya
    Aldry Wijaya almost 9 years
    This trick has helped me a lot.. it makes my MySQL server almost 100x faster.. it will works on WAMP or XAMPP.. For XAMPP, just remove the # sign before "bind-address = ::" line..
  • vladkras
    vladkras over 8 years
    unfortunately didn't help at all. I've added [wampmysqld] section to my /opt/lampp/etc/my.cnf (this config is loaded, I don't have .ini file), restarted, but nothing happened. Anyway thanks for effort. At least it helped someone
  • NullPointer
    NullPointer over 8 years
    You save me friend (y). Hats off for you.
  • user1447420
    user1447420 over 8 years
    Thanks for great solutions. I fixed the problem by disabling ipv6.
  • Matt
    Matt over 8 years
    Prioritizing the httpd.exe fixed it.
  • phil294
    phil294 over 8 years
    "In my case I had two apache processes running. Be sure you only have one running. " - stopping one of them will also kill the other one. Not helpful.
  • phil294
    phil294 over 8 years
    wampmysqld section does not exist in current xampp
  • Rick Kukiela
    Rick Kukiela over 8 years
    @vladkras you need to add it to your [mysqld] section. AND THIS TOTALLY WORKED! THANK YOU!!!!!
  • Marco Demaio
    Marco Demaio over 8 years
    +1 It works like a charm! This one on its own did the trick! I'm on Windows 7 Pro + Apache 2.4 + PHP 5.5.30.
  • user3640967
    user3640967 over 8 years
    You hero! In the end I left xdebug enabled, but turned off the profiler and my script sped up from around 5 minutes to 5 seconds. Thank you!
  • fidev
    fidev over 8 years
    This work for me. Using El Capitan (MAMP) + Apache 2.2.29 + PHP 5.6.10. Especially the lag when running Parallels IE Test Environment.
  • Guntram
    Guntram about 8 years
    for me, this was the only thing to speed it up. surprisingly, internet explorer 11 was really fast with xdebug enabled. chrome and ff were slow as hell...
  • Juan
    Juan almost 8 years
    what about for a real operating system, like osx?
  • luky
    luky over 7 years
    i had same problem, windows 8, phpmyadmin on localhost was opening one small table (29k rows) forever.. once i changed address in URL bar to 127.0.0.1 it loaded instantly.. very strange
  • anoldermark
    anoldermark over 7 years
    Yes - I've tried lots of things - this works for me using XAMPP on W7Pro. It also seems to have fixed some annoying phpMyAdmin stalled refreshes where PMA sits there with a clock icon.
  • Muhammad Saqib
    Muhammad Saqib over 7 years
    Disabling Base Filtering Service on windows seven wamp (x64) worked for me.
  • Leopoldo Sanczyk
    Leopoldo Sanczyk over 7 years
    Thank you. I recovered the faith in technology.
  • Fuxi
    Fuxi over 7 years
    i've tried ANYTHING but changing the power plan did the trick - thanks!
  • webcoder
    webcoder about 7 years
  • Kevin
    Kevin about 7 years
    I'm using Windows Defender and this solution worked for me, I just added the three files to the "Excluded processes" list in Defender
  • AdRock
    AdRock about 7 years
    This is the only thing that worked for me. All the other known fixes I tried and didn't work but this did
  • Andrei Surdu
    Andrei Surdu almost 7 years
    You are my hero!
  • Oliver
    Oliver over 6 years
    I just commented [XDebug] block in php.ini and speed was normal again
  • Jones G
    Jones G over 6 years
    Your a savior! That was causing the problem, now I got 90% improvement in site speed in localhost!
  • Biju P Dais
    Biju P Dais about 6 years
    Updated my.ini for xampp with this and my localhost became lightning fast!!! Cheers to you!!!!
  • kosmos
    kosmos about 6 years
    Disabling the xdebug extension (zend_extension line) worked for me. Now I need a new debugger -.-" Thanks for pointing me to the right direction
  • Xedecimal
    Xedecimal almost 6 years
    One more tip, you are limited to 10 hosts per line in the hosts file. Once you add that 11th one it'll stop recognizing them so make sure you don't add too many on a single line... Thanks Microsoft!
  • Marcelo Agimóvel
    Marcelo Agimóvel almost 6 years
    Just remember to execute as admin.
  • Agung Sagita
    Agung Sagita over 5 years
    first thing i do this and its working wonderfully, other tricks answered above definitely might work, just because this at the bottom of answers, i tried this first and solve my problem, cool !
  • dregad
    dregad over 5 years
    Change your etc/hosts [...] don't add each virtual host on a new line. pointed me in the right direction. It turns out that for some unknown reason I had multiple 127.0.0.1 localhost lines in my hosts file; after removing the extra ones, page loads went from over 5 seconds on average, to under 1 s.
  • Silvio Delgado
    Silvio Delgado about 5 years
    It was exactly what happened to me. Thank you for remember me!
  • FlavioEscobar
    FlavioEscobar about 5 years
    Man, thank you so much for that! Tried so many other things but this was the one and only solution that worked.
  • moshiuramit
    moshiuramit almost 5 years
    Using wamp didn't expected that it will be work. And yet it worked. Thank you.
  • tayyab
    tayyab almost 5 years
    Thanks, just changing the port to 8080 solved all my issues
  • Gisto
    Gisto about 4 years
    THIS!!!! You are a life saver, spent hours and hours trying to get to the bottom of this!!
  • sonnb
    sonnb about 4 years
    This is the reason of my slow with XAMPP. x10 faster after follow this instruction.
  • Mohammed Cherkaoui
    Mohammed Cherkaoui about 4 years
    This worked like charm for me, I've been struggling with this problem for weeks
  • Federico Schiocchet
    Federico Schiocchet almost 4 years
    It didn't fix it, and I'm not surprised of that. Of course the link is not the cause
  • hameds1
    hameds1 over 3 years
    setting apache high priority worked for me
  • summsel
    summsel about 3 years
    even 2021 this solution is working! Win10, Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.11 Datenbank-Client Version: libmysql - mysqlnd 5.0.12-dev
  • Engr. Meshach Koech
    Engr. Meshach Koech over 2 years
    This solution worked for me, I tried all the others but noticed in my task manager once I launch the local host, very many processes related to bit defender service host will start running. Added the exceptions to bit defender and now works like charm.
  • not_a_generic_user
    not_a_generic_user almost 2 years
    Despite all the detailed stuff above (most of which I did other than turning off BFE and other things that seemed like bad ideas, THIS was the one that worked. In my my.ini under [mysqld], there's an entry already for bind-address that goes to 127.0.0.1. I changed it to :: and phpmyadmin results show instantly now instead of after 10 to 20 seconds.