Wamp's localhost taking so much time on opening

5,306

I had this issue as well and while looking for a solution, I read several pages with advice on fixing this it. (1), (2), (3), (4).

There are several suggestions, but the general consensus seems to be that the two most effective fixes are the following:

  • Changing PHP to be run as an Apache module or as a Fast-CGI process (I have seen both suggested as being faster)
  • Adding a line to the HOSTS file to resolve localhost: 127.0.0.1 localhost
  • Disable IPv6
  • Replace all occurrences of localhost in your configuration files (for Apache, MySQL, and PHP) with 127.0.0.1

I ended up adding a registry entry to disable IPv6, but I have not rebooted yet, and moreover, I had already disabled it through the normal Windows interface settings, so I don’t think it has had any effect yet.

I also replaced localhost with 127.0.0.1 in my configuration files which seems to have had the most effect, bringing my WordPress page-loading times down from ~7 seconds down to ~2 seconds.

In addition, I also performed a test whereby I started the dnscache service (after replacing my normal, large hosts file with a tiny one of course). That seems to have drastically increased all browsing performance (which means I now have to find a way to get around the 100%-CPU load that the service creates with a large hosts file).

Share:
5,306

Related videos on Youtube

NullPointer
Author by

NullPointer

It's a fun :) when working with computers and programming but sometimes it's scary :( too. profile for NullPointer on Stack Exchange, a network of free, community-driven Q&A sites http://stackexchange.com/users/flair/2476406.png

Updated on September 18, 2022

Comments

  • NullPointer
    NullPointer over 1 year

    I have following configuration for WAMP on local machine Windows 7.

    enter image description here

    When I try to open localhost from WAMP Notification icon, it's taking so much time (around in minutes). Even phpmyadmin is taking so much time.

    Any idea that How to resolve this?

    • harrymc
      harrymc over 10 years
      You can find a collection of workarounds in this answer. It would be useful to try them out and add some comments regarding your (lack of) success into your post.
    • NullPointer
      NullPointer over 10 years
      Thanks @harrymc. Sure I will go through the Answer you suggested in link.
    • Synetech
      Synetech over 10 years
      I’ve been having a similar problem with my homemade WAMP stack. Mine isn’t quite that slow, but it’s slow enough that using WordPress becomes sufficiently frustrating that I can’t just open a browser window, click a link, then type up an article when I get an idea for one; I end up putting them in text-files for batch-entry later on. In my case, I strongly suspect that the problem is because I am using a FastCGI version of PHP because I was lead to believe that it was faster. Go figure. What’s your configuration? Do you get instances of php-cgi.exe running or is your PHP an Apache module?
    • NullPointer
      NullPointer over 10 years
      @Synetech, Yes. PHP as an Apache Module like following entry in httpd.conf file LoadModule php5_module
    • Synetech
      Synetech over 10 years
      I’ve read advice about improving performance by changing PHP to load as a Fast-CGI process as well as changing to load as an Apache module. This mutually exclusive advice isn’t particularly useful. Personally, I currently have it running as FCGI, but that means that you cannot set PHP directives in an .htaccess file per-directory, so I’m going to change it back to an Apache module.
  • NullPointer
    NullPointer over 10 years
    A am appreciating your answer :)
  • Synetech
    Synetech over 10 years
    Happy to help. Let me know what your results are. If it doesn’t work, then we can try some of the other suggestions.