简体   繁体   中英

WAMP is running very slow

I am using WAMP ( localhost ) on Windows 7.

When I am running my localhost it takes more than 1 minute to load the page. There are no queries or database connectivity. If it's just an HTML page, it also takes the same time, and if the Inte.net is connected it works normally. If Inte.net is connected it works perfectly. When the Inte.net is not available it takes more than 1 minutes to load a simple page.

How can I fix this?

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

(Method 1) Left 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.

Set mysql_connect('127.0.0.1'... instead of mysql_connect('localhost'....

WAMP/XAMPP is responding very slow over localhost

I tried a lot of the answers on here without much success. It was PHP itself where the bottleneck was occurring. I disabled Xdebug and my page-load time went from ~1200 ms to ~275 ms. That was where the biggest single gain occurred, by far.

Instead of using the hostname “localhost”, use an IP address in your MySQL connection string.

Typically, your WAMP installation is found in C:\\wamp . Edit this file with Notepad :

C:\wamp\www\wp-config.php

Replace

define("DB_HOST", "localhost");

with

define("DB_HOST", "127.0.0.1");

Restart the WAMP services.

You can check out more details on this website .

将文件php.ini的 PHP SMTP 服务器从localhost更改为127.0.0.1 ,在我的原版副本中的第 1084 行,成功了。

Accessing my local content on 127.0.0.1 instead of localhost worked for me (so probably a DNS resolve issue is hidden somewhere):

  • http://127.0.0.1/mysite is fast

  • http://localhost/mysite is slow

Here is a list of changes I made to make WAMP faster in my Windows 10 Pro 64 bit:

  1. Edited hosts file and added: 127.0.0.1 localhost
  2. Edited hosts file and added: 127.0.0.1 myVhosts ( note: I added all other entries in the same line as the first one. I don't create multiple lines to point 127.0.0.1 to different places. So I only have one 127.0.0.1 and then next to it, any vhosts or anything else that I want to point to it )
  3. Edited my.ini and added: bind-address="127.0.0.1" (below [wampmysqld64] )
  4. Disabled cgi_module from Apache** → Apache Modulescgi_module (uncheck it)
  5. Disabled XDEBUG Extension from php.ini
  6. As I have Anti-Virus and Firewall, added httpd.exe and mysqld.exe files (as well as PHP CLI and CGI binaries, and PHP's DLL files) to the exceptions.
  7. Turned on EnableMMAP and EnableSendfile in httpd.conf
  8. Set realpath_cache_size to 4096k in php.ini
  9. In the end, edited the configuration file of projects and replaced the localhost with 127.0.0.1 as well.

I also recommend checking this article: WAMP is Running Very Slow . They covered a lot of changes that may help you as well.

Uncommenting this line in the hosts file worked for me:

# 'localhost' name resolution is handled within DNS itself.
    127.0.0.1       localhost
#   ::1             localhost

Uncommenting 127.0.01 localhost . And after that it's super fast.

Adding to tvanc's answer , also disable the Xdebug profiler in php.ini with xdebug.profiler_enable=Off or xdebug.profiler_enable=0 .

You might also increase the PHP memory limit. Search for memory_limit in php.ini .

There are also some useful tips at WAMP is Running Very Slow which are too numerous to list here.

My problem was of a smaller scale. An empty PHP page went from almost instant rendering to about 1 second.

It turned out that my Xdebug settings were causing the problem. I had xdebug.remote_enable=on set in the php.ini file, and this was causing the delay. Before I was starting, the debug session was using an idekey, so I only got the delay when starting a debug session. Commenting the line out solved the problem.

I'm running Windows 8, and WAMP was very slow. I did all suggested before. With a difference; WAMP had httpd.conf by default:

AcceptFilter http none
AcceptFilter https none

So I did the contrary thinking: Maybe this is not needed any more. It seems to work fine:

 #AcceptFilter http none
 #AcceptFilter https none

Maybe is not a problem in all Windows versions. In httpd you read:

# AcceptFilter: On Windows, none uses accept() rather than AcceptEx() and
# will not recycle sockets between connections. This is useful for network
# adapters with broken driver support, as well as some virtual network
# providers such as vpn drivers, or spam, virus or spyware filters.
#AcceptFilter http none
#AcceptFilter https none

This issue was plaguing me after I upgraded WAMP Server from 2.2 to 2.4.

I eventually found the solution, as detailed in this blog post: Apache server 2.4.6 hangs after serving requests from Internet Explorer 10/11

Add the following to Apache's configuration file (httpd.conf):

AcceptFilter http none
AcceptFilter https none

This may sound really simple, but if you are using Notepad++'s menu RunLaunch in <browser> option (eg Launch in Firefox ), it loads as file:///C:/wamp/www/dynamic/index.php instead of localhost/dynamic/index.php .

If this is the case then try going to localhost/dynamic/index.php in the URL bar on your own, and it will load much faster.

I ran into this issue specifically in Chrome. Emptying the browser cache completely solved it.

In my case the slowness was because I was on a corporate VPN and also had a proxy URL set in Chrome. Off the VPN everything loaded fast.

To get things to work on the VPN, I removed the proxy setting from Chrome. Things mostly worked then, but a search for WordPress plugins or themes from the dashboard still failed.

I added the following to wp-config.php and then search worked too:

 /** proxy settings */
 define('WP_PROXY_HOST', 'proxy.url.com');
 define('WP_PROXY_PORT', '1234');
 define('WP_PROXY_USERNAME', '');
 define('WP_PROXY_PASSWORD', '');
 define('WP_PROXY_BYPASS_HOSTS', 'localhost');

Turning off the cgi_module also worked for me with WAMP + WordPress. I wanted to share that you can also do this with the WYSIWYG in WampServer 2.5.

  • Click on the WAMP Quick Launch Icon in the Taskbar.
  • Hover over ApacheApache Modules
  • Click to remove the check mark from cgi_module

WAMP should restart itself, and you should see the speed pick up.

I ran into the same problem and changed all the options mentioned.

After that, I saw that a Drupal database with extreme weight was causing the problem. Clearing the watchdog table and cache solved the problem.

I tried everything, and nothing worked. Then I found out by removing all session references WAMP was 20 times faster. As the sessions were being locked, so when the same application requested multiple pages it was super slow.

I followed all these and the links with no joy. Gold for my Wamp v7.3.16-2 was setting bind-address=:: in MySQL's my.ini file. Response time went from minimum of 2 seconds to zero.

Thanks to http://regularcoder.com/tutorial/wamp-optimization-for-better-performance/#comment-30

I've found that it somehow helps a lot not to reload the page, but rather go to another page, and click the link (if it it exists) to the previous page

I do this, since I have a menu bar, so I just click another link, and then back.

This only solves the problem for some time. After a while it becomes slow again.

Run WAMP only. Quit other applications which use the Internet.

使用以下 DNS 服务器地址首选 DNS 服务器中添加127.0.0.1作为您的 DNS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM