Solved: WordPress Running Too Slow On Localhost

If you are using WAMP server for local WordPress development and WordPress Running Too Slow On Localhost. You should disable cgi_module. Read tutorial to learn more.

Posted on by

I have been using WAMP server for a long time to set up local WordPress installations, Local development Servers like WAMP, XAMPP and Bitmami makes is very simple and easy to build WordPress themes, plugins and Websites for customers.

WAMP, XAMPP and Bitnami are free softwares. You can set up a local development server very easily with these awesome free products. I like to use WAMP, because I can set up multiple local WordPress installations.

You can also use XAMPP or Bitnami, both are awesome products. In this article, I am going to share few tips for WordPress developers to make WordPress load faster on localhost.

If you are using WordPress and WAMP server for local development and localhost takes too much time to load your site. You can very easily solve this problem.

especially, If WordPress running too slow on localhost and taking too much time to load. You can fix this issue very easily.

NOTE: Solution 1 worked for me and after disabling cgi_module, local WordPress website was very fast.

You can also read the original thread at stackoverflow

1. Disable cgi_module in WAMP

The solution that worked for me was to disable 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.

See the screenshot below.

wordpress running too slow on localhost wamp solution
how to Disable Cgi_module In WAMP

2. Disable XDebug

It was PHP itself where the bottleneck was occurring. I disabled XDebug and my page-load time went from ~1200ms to ~275ms. That was where the biggest single gain occurred, by far. Turibe

How To Disable XDebug

If you are using WAMP server, left click on WAMP Server in System Tray, Go to PHP > php.ini. open this file in text editor, Search for XDEBUG and add following 3 lines.

Set xdebug autostart to false

xdebug.remote_autostart=0
xdebug.remote_enable=0

Disable your profiler

xdebug.profiler_enable=0

You can see the screenshot below.

How To Disable XDebug WAMP Server
How To Disable XDebug WAMP Server

Source: StackOverflow

11 responses on “Solved: WordPress Running Too Slow On Localhost

  1. david

    I had similar problems running my localhost website from a usb using XAMPP and WAMP, for me what turned it back into a website with normal response times was using UwAmp . Also used a USB 3.0 Flash Drive, not sure how much difference that made.
    Hope this helps someone.
    David

  2. Loremar Guimarães

    Disabling CGI worked for me. It’s running much faster now. I think that I would have to tune it up a little more but disabling CGI turned admin panel usable again. Thanks!

  3. scuzzy

    I’ve had the same problem on Linux. Nothing worked including disabling cgi, tuning databases, etc.
    Here’s what did work for me. Running Centos 7.3.
    I have multiple vhosts running under Apache 2.4.
    WP domain: mysite.org
    In /etc/hosts
    127.0.0.1 mysite.org
    This was slow as heck on a fast computer. I’d tried everything. Then I determined it was a problem was with WP resolving ‘things.’ WP uses locahost.
    My IP address on my local network was 192.168.0.106. I then tried that.
    Changed /etc/hosts
    192.168.0.106 mysite.org
    Now WP runs fast on my local test server.

    1. mk

      steps:
      1. get local ipadress
      2. do change on host file
      3. change wordpress adress in wp-admin/options-general

      *might be that it just feels faster after this but thats also something… :D…

  4. Faisal

    Hi Admin…
    after i use google AdSense and analytics code in WordPress My site is slow, and they told me to fix it as below Do you have a solution to this problem.
    Setting an expiry date or a maximum age in the HTTP header
    pagead2.googlesyndication.com/pagead/js/adsbygoogle.js (60 minutes)
    pagead2.googlesyndication.com/pagead/osd.js (60 minutes)
    google-analytics.com/analytics.js (2 hours)
    My site: gooeos.com

Leave a Reply

Your email address will not be published. Required fields are marked *