WAMP/XAMPP is responding very slow over localhost

PhpApacheXamppLocalhostWamp

Php Problem Overview


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.

Php Solutions


Solution 1 - Php

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 - Php

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 - Php

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 - Php

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 - Php

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"

Solution 6 - Php

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.

Solution 7 - Php

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

Solution 8 - Php

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.

Solution 9 - Php

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.

Solution 10 - Php

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

Solution 11 - Php

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

Solution 12 - Php

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

Solution 13 - Php

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

Solution 14 - Php

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.

Solution 15 - Php

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.

Solution 16 - Php

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.

Solution 17 - Php

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.

Solution 18 - Php

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

Solution 19 - Php

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

Solution 20 - Php

After trying some answers and comments here, I finally found a solution! In this article [The correct way to configure PHP][1] 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.

[1]: https://www.devside.net/articles/php "The correct way to configure PHP"

Solution 21 - Php

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.

Solution 22 - Php

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

Solution 23 - Php

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

Solution 24 - Php

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.

Solution 25 - Php

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.

Solution 26 - Php

Just try "Incognito" mode in Chrome.

Finally, this helped me to solve my issue.

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

Solution 27 - Php

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFBwallView Question on Stackoverflow
Solution 1 - PhpbicycleView Answer on Stackoverflow
Solution 2 - PhpHonestaView Answer on Stackoverflow
Solution 3 - PhpStephanView Answer on Stackoverflow
Solution 4 - PhpnonameView Answer on Stackoverflow
Solution 5 - PhptrogneView Answer on Stackoverflow
Solution 6 - Phpuser3476854View Answer on Stackoverflow
Solution 7 - PhpSujay sreedharView Answer on Stackoverflow
Solution 8 - PhpvcoppolecchiaView Answer on Stackoverflow
Solution 9 - PhpMita KaView Answer on Stackoverflow
Solution 10 - PhprightstuffView Answer on Stackoverflow
Solution 11 - PhpMaxView Answer on Stackoverflow
Solution 12 - PhpMaverickView Answer on Stackoverflow
Solution 13 - PhpShrikant DView Answer on Stackoverflow
Solution 14 - PhpTyronView Answer on Stackoverflow
Solution 15 - PhpEmanuelView Answer on Stackoverflow
Solution 16 - PhpguntarsView Answer on Stackoverflow
Solution 17 - PhpbagnapView Answer on Stackoverflow
Solution 18 - PhpSarthak SrivastavaView Answer on Stackoverflow
Solution 19 - PhpSREE ANIView Answer on Stackoverflow
Solution 20 - PhpMetafanielView Answer on Stackoverflow
Solution 21 - PhpareebView Answer on Stackoverflow
Solution 22 - PhpHassan RazaView Answer on Stackoverflow
Solution 23 - PhpO.TadjView Answer on Stackoverflow
Solution 24 - PhpMagnus72View Answer on Stackoverflow
Solution 25 - PhpstepView Answer on Stackoverflow
Solution 26 - PhpRoshan PereraView Answer on Stackoverflow
Solution 27 - Phpuser979626View Answer on Stackoverflow