[php] WAMP/XAMPP is responding very slow over localhost

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.

This question is related to php apache xampp localhost wamp

The answer is


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


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.


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


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.


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.


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


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.


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

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.


Just try "Incognito" mode in Chrome.

Finally, this helped me to solve my issue.

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


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

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.


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.


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


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


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.

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.


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


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


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.


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!


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"

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


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.


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!


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.


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to apache

Enable PHP Apache2 Switch php versions on commandline ubuntu 16.04 Laravel: PDOException: could not find driver How to deploy a React App on Apache web server Apache POI error loading XSSFWorkbook class How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to enable php7 module in apache? java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing while starting Apache server on my computer

Examples related to xampp

Xampp localhost/dashboard phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) Is there way to use two PHP versions in XAMPP? Where to find htdocs in XAMPP Mac phpMyAdmin access denied for user 'root'@'localhost' (using password: NO) How to downgrade php from 7.1.1 to 5.6 in xampp 7.1.1? How to turn on/off MySQL strict mode in localhost (xampp)? mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it How to install mcrypt extension in xampp Fatal error: Uncaught Error: Call to undefined function mysql_connect()

Examples related to localhost

Xampp localhost/dashboard Set cookies for cross origin requests Invalid Host Header when ngrok tries to connect to React dev server How to turn on/off MySQL strict mode in localhost (xampp)? What is IPV6 for localhost and 0.0.0.0? How do I kill the process currently using a port on localhost in Windows? How to run html file on localhost? Can't access 127.0.0.1 Server http:/localhost:8080 requires a user name and a password. The server says: XDB How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?

Examples related to wamp

WAMP won't turn green. And the VCRUNTIME140.dll error cURL error 60: SSL certificate: unable to get local issuer certificate How to enable local network users to access my WAMP sites? WampServer: php-win.exe The program can't start because MSVCR110.dll is missing Project Links do not work on Wamp Server ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it Apache won't start in wamp How to send email from localhost WAMP Server to send email Gmail Hotmail or so forth? Fatal error: Call to undefined function sqlsrv_connect() WampServer orange icon