WAMP/XAMPP is responding very slow over localhost
Asked Answered
A

27

146

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.

Adnate answered 8/12, 2011 at 14:34 Comment(7)
I have also the same issue. The issue was with Apache's main settings file httpd.conf. See this link for a solution that worked for me: serverfault.com/questions/66347/…Toluidine
I added LoadModule php5_module "C:/xampp/php/php5apache2_2.dll" on htpd.conf and restarted it but it didn't help at all.Adnate
Hmm, do you have a fresh install of xampp or do you have any frameworks running? Also you dont need this line 127.0.0.1 localhost in the hosts file twice so try taking one outDeathwatch
the problem got fixed, i did nothing. It just suddenly responded fast again after a couple of days. Sigh.Adnate
@all, I have a question for those that proposed solutions that involve adding or replacing text with 127.0.0.1: what happens if you access 127.0.0.2, or 127.1.2.3 or some other loopback address? For example, if MySQL is bound to 127.0.0.2, will hard-coding 127.0.0.1 in the Apache conf files still work?Francefrancene
I've tried EVERY SINGLE suggestion in this thread and NOTHING, my localhost is still TOO SLOW. I even didn't use WAMP or XAMPP I installed Apache, PHP and MySQL manually, and it takes about 45 secs every page load =/ This is reaaaaally annoying -_-Liturgics
Running XAMPP as an Administrator worked for meTransmit
F
119

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.

Fisticuffs answered 18/6, 2013 at 7:41 Comment(18)
this is a good collection of answers, the only thing i did and work for me was disabling IPv6, thats all, so thanks ;)Besought
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.Francefrancene
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.Fisticuffs
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.Assurgent
@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.Quantity
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.Inutile
Thanks for great solutions. I fixed the problem by disabling ipv6.Mummify
Prioritizing the httpd.exe fixed it.Marcellmarcella
"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.Soult
what about for a real operating system, like osx?Halfpenny
Disabling Base Filtering Service on windows seven wamp (x64) worked for me.Fidole
i've tried ANYTHING but changing the power plan did the trick - thanks!Helico
We should follow Microsoft's recommendations about disabling IPv6 - Reference LinkSclerosed
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!Lolita
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.Decomposer
Thanks, just changing the port to 8080 solved all my issuesJimmy
setting apache high priority worked for meBrinton
The usefulness of this answer is offset by the risk of a lot of dangerous suggestions. Just because turning a system process off speeds something up doesn't make it a good idea.Affright
B
102

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!

Backwater answered 15/1, 2014 at 13:22 Comment(5)
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..Chitkara
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 someoneMinion
Updated my.ini for xampp with this and my localhost became lightning fast!!! Cheers to you!!!!Strobilaceous
This is the reason of my slow with XAMPP. x10 faster after follow this instruction.Cerography
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.Debate
M
56

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

Medeah answered 13/11, 2012 at 12:26 Comment(9)
That speed up the request time by about 80%. Why is PHP so slow to connect to MySQL with localhost under Windows 8?Oedema
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.Cowled
It reduced the response time to 20% on windows 8.1. Thanks for the answer. Same question as wowpartick'sAstragal
Great - it reduced the request time from 1,03 sec. to ~15ms. Thanks! (Using win8.1 64bit)Inutile
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 strangeBullshit
Thank you. I recovered the faith in technology.Regatta
It didn't fix it, and I'm not surprised of that. Of course the link is not the causeSubmicroscopic
@FedericoSchiocchet Are you using WAMP or XAMPP?Affright
Hi I use XAMPP :)Submicroscopic
S
52

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"
Silence answered 20/2, 2014 at 19:53 Comment(10)
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: #24893510 Thanks!Vltava
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!Perfuse
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.Alston
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!Architectural
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...Belk
I just commented [XDebug] block in php.ini and speed was normal againByword
Your a savior! That was causing the problem, now I got 90% improvement in site speed in localhost!Subak
Man, thank you so much for that! Tried so many other things but this was the one and only solution that worked.Lathy
I even upgraded my laptop thinking that it's due to my processor speed, but still was stuck at this issue. disabling zend was the solution at the end ... spend $3400 on a new laptop xD wish I had spend 1 hour on stack overflowRightly
It worked for me on windows 11Pooka
L
48

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.

Loosejointed answered 13/9, 2013 at 12:50 Comment(5)
+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.Swats
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.Ferrel
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.Andryc
This is the only thing that worked for me. All the other known fixes I tried and didn't work but this didPneumogastric
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-devColfin
P
23

For me using xDebug, this line in php.ini was the performance killer:

xdebug.remote_autostart=true

When I removed it the page was fast again.

Palaestra answered 29/3, 2014 at 22:37 Comment(1)
Disabling the xdebug extension (zend_extension line) worked for me. Now I need a new debugger -.-" Thanks for pointing me to the right directionInterferon
D
18

if you are using mysql use 127.0.0.1 instead of localhost in mysql_connect function it helped me

Dig answered 14/3, 2013 at 9:26 Comment(0)
H
15

I'm not yet able to comment under @Honesta answer, so I'll write here the way I manage to solve it.

My environment (I don't know if this is relevant for the answer)

  • XAMPP (version 5.6.3)
  • Windows 8.1 Pro (64 bit)

How to

I just opened my.ini file and uncommented the line where it says

bind-address="127.0.0.1"

This file is located, for XAMPP users, in C:\xampp\mysql\bin\my.ini.

Credits

This article helped me to solve the problem, although I didn't needed everything in it because some setup in XAMPP were not requested.

Host answered 17/4, 2015 at 11:27 Comment(0)
C
9

I've just fixed such an issue on my laptop running windows 10. Suddenly wamp became super slow - a request to load a page was taking 2 minutes.

After trying numerous things, what it turned out to fix the problem was disabling windows defender. All worked like a charm after that.

p.s. I'd suggest you add your apache root dir to the exceptions list and not actually disable defender completely.

Cootch answered 13/10, 2015 at 6:41 Comment(2)
THIS!!!! You are a life saver, spent hours and hours trying to get to the bottom of this!!Tyrannize
This worked like charm for me, I've been struggling with this problem for weeksGranthem
I
6

As most of the answers have pointed out, using the IP address 127.0.0.1 over "localhost" will sometimes help the slowness issue - but this isn't really a solution because it does not fix the underlining problem.

What makes this problem hard (and hit-and-miss), is it can be caused by about a dozen different things between the OS, the WAMP configuration, and your Browser.

  1. Remove ::1 localhost from your Windows hosts file, and make sure 127.0.0.1 localhost is present. You want your request to go directly to the listening IPv4 socket.

  2. Disable IPv6 on your system. You are most likely not using it, and it has been known to cause all kinds of issues.

  3. Exclude your Apache and MySQL binary paths, and the Database folder, from your firewall and anti-virus software. They will interfere and slow things down.

  4. Reset your TCP/IP sub-system and reboot: netsh int ip reset c:\resetlog.txt

  5. Make sure your system is not using stale DNS servers: ipconfig /all

  6. Flush Windows DNS cache: ipconfig /flushdns

  7. Clear your Browser's Cache.

A little more in-depth is this guide: WAMP is Running Very Slow

Impostor answered 11/12, 2013 at 0:24 Comment(1)
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 !Floats
A
6

After try each instuction on this post, for me works when i add in:

Avira >>
Real-Time Protection >>
Configuration >>
Exception >>

Add Proccess:

  1. xampp\apache\bin\httpd.exe
  2. xampp\mysql\bin\mysqld.exe
  3. xampp\xampp-control.exe

enter image description here

Approach answered 13/5, 2016 at 12:58 Comment(2)
I'm using Windows Defender and this solution worked for me, I just added the three files to the "Excluded processes" list in DefenderBryology
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.Converter
L
4

For my it was the xdebug. I disabled and it worked as it should be !

[XDebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.3.2-5.6-vc11.dll
Longinus answered 27/5, 2015 at 17:59 Comment(1)
It was exactly what happened to me. Thank you for remember me!Suspension
F
3

I am using wamp64 on my windows 10 machine. I was having the same issue and turning off Xdebug of from my php.ini file resolves the issue for me.

; [xdebug]
; zend_extension ="C:/wamp64/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11-x86_64.dll"
; xdebug.remote_enable = off
; xdebug.profiler_enable = off
; xdebug.profiler_enable_trigger = off
; xdebug.profiler_output_name = cachegrind.out.%t.%p
; xdebug.profiler_output_dir ="C:/wamp64/tmp"
; xdebug.show_local_vars=0
Fogged answered 4/11, 2017 at 8:5 Comment(0)
C
2

I had the same problem. Response times were extremly slow and refreshes worked quickly, most of the time. All suggestions made by bicycle didn't help. What seems to help best so far (no slow response times for the last 30mins) was to reset winsock as explained here: http://www.devside.net/wamp-server/wamp-is-running-very-slow

netsh winsock reset
netsh int ip reset C:\resetlog.txt

You need to restart after this.

Chen answered 8/1, 2015 at 9:2 Comment(1)
Just remember to execute as admin.Greensboro
A
2

Using Windows 10 (june of 2018), I managed to improve the loading that went from 2 seconds to less than 400 milliseconds doing a set of things I saw in this post and the internet

Disabled xdebug in php.ini

; [xdebug]
; zend_extension ="C:/wamp64/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11-x86_64.dll"
; xdebug.remote_enable = off
; xdebug.profiler_enable = off
; xdebug.profiler_enable_trigger = off
; xdebug.profiler_output_name = cachegrind.out.%t.%p
; xdebug.profiler_output_dir ="C:/wamp64/tmp"
; xdebug.show_local_vars=0

Used 127.0.0.1 in installation, in my case of Wordpress

Using @honesta method

edit mysql file 'my.ini'

under the [wampmysqld] add the following:

bind-address = ::

And disabling cgi module like @Iulian Dita said

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.
Anallise answered 7/6, 2018 at 4:23 Comment(0)
L
1

Had the same issue in Chrome and it did not go away after applying all the known remedies. For me the resolution was to uncheck "Enable phishing and malware protection" in Chrome settings (Settings -> Show advanced settings -> Privacy). After that localhost is lightningfast.

Layer answered 6/12, 2013 at 10:25 Comment(0)
S
1

I had this problem too.

I added the entries suggested above but it failed to work.

It was due to the fact Spybot Search and Destroy had added 15,000 lines of immunized site (ie prevents you from visiting them) to my hosts file.

My hosts file was 433k - I removed those lines and my page load speed improved immensely.

Siliculose answered 19/1, 2014 at 8:57 Comment(0)
L
1

Changing(Updating) my PHP version from 5.5.25 to 7.0.10 solved this problem in my case.

Lisandra answered 12/7, 2018 at 9:39 Comment(0)
C
1

Power plan was the problem.Changed Balanced to High performance.

Chromic answered 6/8, 2019 at 3:55 Comment(0)
L
0

After trying some answers and comments here, I finally found a solution! In this article The correct way to configure PHP I find a new way to configure PHP as a module in Apache.

For the author of this article, the official way to configure PHP is not the most optimal. The common and inappropriate way to configure PHP is this one:

# For PHP 5:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

I've always done it this way, but in the article, it's suggested to configure the PHP module this way:

#For PHP5
LoadFile "C:/www/php5/php5ts.dll"
LoadModule php5_module "C:/www/php5/php5apache2.dll"

<IfModule php5_module>
    #PHPIniDir "C:/Windows"
    #PHPIniDir "C:/Winnt"

    <Location />
        AddType text/html .php .phps
        AddHandler application/x-httpd-php .php
        AddHandler application/x-httpd-php-source .phps
    </Location>

</IfModule>

I even have IPV6 enabled, and my loading time drop down from 45 secs or 1 minute or more, to just 2 or 4 seconds! Thanks to other answers mentioned here, I also left enabled in my general configuration the following

HOST FILE:

127.0.0.1       localhost
127.0.0.1       127.0.0.1
#   ::1         localhost

HTTPD.CONF

EnableMMAP on
EnableSendfile on
AcceptFilter http none 
AcceptFilter https none
HostnameLookups Off

Other than that, I rolled back all other solutions I tried, so I'm sure this is the only ones that I used.

Liturgics answered 24/2, 2015 at 17:13 Comment(0)
E
0

If you are using PHP Xdebug for debugging purpose, remove that file. It worked for me. The response time reduced from 950ms to 125ms.

Empale answered 10/2, 2019 at 18:2 Comment(0)
P
0

I have had suspicions Chrome is starting to get stupid and bulky for a while, and my problems started after updating it. Since Ampps worked better when connected to Internet I put 1 + 1 together. Under Chrome Advanced settings try to dig into the Preload webpages for better performance feature. And kill it.

Ironic, but not unexpected, as it seems to get confused about preloading Localhost. In my case it was the instant fix after hours of wasted config fiddling and weeks of suffering.

Thank you Google devs.

Protohuman answered 1/1, 2020 at 18:30 Comment(0)
P
0

I have enebled xdebug. And I found that when my IDE PhpStorm was shutdown it was very slow. After I started my IDE, than it was fast. I dont know why but hope that it will help other people.

Permittivity answered 28/3, 2022 at 21:11 Comment(0)
I
-1

I have the same issue but I resolve issue from database.I had rename table name and create new table with out index through which all indexes effected and I had huge amount of data in table.I again rename original table, it has fixed for me.

Itinerary answered 10/6, 2015 at 14:12 Comment(0)
B
-1

I don't know why, but closing my internet connection solved this problem for me.

Bea answered 22/11, 2019 at 8:3 Comment(0)
S
-3

Just try "Incognito" mode in Chrome.

Finally, this helped me to solve my issue.

Please keep your mind, this is not a permanent solution.

Saguaro answered 14/8, 2017 at 6:29 Comment(0)
K
-7

I run on wamp and I had this problem once. There can be many factors to this though there is 5 main ones that come to my mind.

1st. A program can cause this(Even antivirus software just depends what you have.)

2nd. Is your computer full or using alot of space this happen to a partner site of mine.

3rd. Check your regerstry files there could be errors or other things. (This end up being my problem.)

4th. After you uninstalled it did you manually delete the files that were left on your computer.(Yes even after you uninstall with wamp it has a tendency to leave a folder or 2 with some important data on it. When you install this will not be remodified and will stay the same.)

5th. Download the latest wamp or the lastest stable version of it.

Hope one of these things help.

Kerrill answered 8/12, 2011 at 19:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.