5

I've recently installed WordPress onto localhost using XAMPP to host it. For some bizarre reason, accessing any page from the WordPress site (including the admin panel) is very slow.

I've tried changing the host file to show:

127.0.0.1 127.0.0.1
127.0.0.1 localhost

But it hasn't made the slightest difference. My machine specs are fairly high, so this doesn't seem to be an issue. I'm currently in the process of downloading a new browser (currently using IE) - although i doubt this'll help the issue.

user2553024
  • 51
  • 1
  • 1
  • 2
  • Does this answer your question? [XAMPP Running really slowly with PHP/MySQL](https://stackoverflow.com/questions/8196009/xampp-running-really-slowly-with-php-mysql) – user4157124 Oct 28 '20 at 23:12

7 Answers7

22

I've been digesting the web to find a solution for that, and it seems that it depends on your environment; in my case, it was working just fine until I installed Eclipse with Worklight.

Anyway, I just figured out how to overcome the very slow response time.

If Apache and MySQL are not installed as a service (no green checkmark beside the module name in XAMPP control panel) like this... like this ...follow these steps to do so:

  1. Stop Apache and MySQL and close XAMPP
  2. Go to XAMPP location (by default c:/xampp)
  3. Right-click on xampp_start.exe > "Properties" > "Compatibility" tab; check "Run this program as an administrator"
  4. Repeat the above step with xampp_control.exe (don't run XAMPP now)
  5. Now you will be able to start mysql_start.bat and apache_start.bat
  6. Now open XAMPP (you will get a UAC alert about launching the program as administrator)
  7. You will find a red crossmark beside Apache and MySQL module, just click on the red crossmark beside each module and agree to install as service (if modules are running you have to stop them first)

This really works for me after a very long time-consuming web search with no luck at all. I hope it helps.

Sarah Lewis
  • 280
  • 2
  • 15
Mou
  • 391
  • 4
  • 14
  • Also edit the xampp-control.ini file and set [EnableServices] Apache=1 MySQL=1. Only then you can install them as service. – alex Apr 21 '16 at 12:28
2

In your WordPress wp-config.php file, is the entry for DB_HOST ‘localhost’? If so, change it to ‘127.0.0.1’ and see if it helps.

Frank
  • 71
  • 2
0

You can try comment out the IPv6 localhost in your host file.

# ::1 localhost

Based on my previous experience, one of the most common reasons of slowness is caused by your code trying to connect to MySQL server via 'localhost', which then resolved to the IPv6 address ::1. However, for XAMPP package, MySQL server is not listening to this address by default. It only listen to the IPv4 address of 127.0.0.1. It will only try to reconnect with 127.0.0.1 after ::1 timeout.

Another option would be to amend your code to connect to MySQL server via '127.0.0.1' directly.

Boon Kgim
  • 56
  • 4
0

I have read thru a lot of posts and tried out most of the given solutions. Nothing worked for me :( Finally I have got my problem fixed very easily by just adding an exception in windows defender for the folder (located on my sd card) containing all my websites. I run xampp 3.2.2. on windows 10 on my MS surface Pro and had trouble mostly with WordPress sites running extremely slow (minutes to load). But in general the loading of all sites was not fast enough. Now it went from minutes to the normal 2-3 seconds on WordPress sites with lost of css effects.

Hopes this helps someone ;)

timniko
  • 69
  • 5
0

How about disabling LoadModule cgi_module modules/mod_cgi.so in httpd.config. It might speed up your loading page.

Steve Czetty
  • 5,972
  • 8
  • 37
  • 48
0

Create a rule and allow XAMPP in Windows firewall did the trick for me. Now loads instantly.

Dilhan
  • 11
  • 1
0

When i developed for wordpress, i too had this issue. My solution was to set up a virtualbox running debian with 2 set cores and 2GB of ram using the netinstall, then set up openlitespeed and the usual with lsphp. XAMPP uses apache but with only essentials, so you do not get php-fpm and other goodies as the idea is on xampp is that it works rather than it works fast.

Since wordpress setups tend to be heavy on resource, not even a high spec machine will run xampp and wordpress well. The easiest solution is to use virtualbox and set up openlitespeed (with 2GB of ram you could install cyberpanel enterprise package for free, ready to use on install with all webserver utilities). This is why most hosts like around 80% including "wordpress recommended" are actually super slow and terrible. Where i work we have our own dedicated server for client wordpress sites that we optimise for to make it very fast, where even a thousand hits on the login page in a second takes barely any resource rather than relying on a shared host for each client.

Apache is actually very slow for your typical plugin heavy wordpress, and needs a lot of tweaking to run fast. Openlitespeed comes ready to use so you only have to configure your hosts file and virtual hosts to get started with a lot of performance

Error Messages
  • 195
  • 1
  • 2
  • 15