Reputation: 101
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.
Upvotes: 10
Views: 28671
Reputation: 1
I followed Dilhan's suggestion about Windows firewall. I am using Laragon and running Ngix and Mysql. I noticed after I have added Laragon, Ngix and Mysql to the Windows Defender Firewall and checked both Private and Public checkboxes, it seems to have solved the Wordpress slow loading on localhost.
Upvotes: 0
Reputation: 328
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
Upvotes: 1
Reputation: 57
Create a rule and allow XAMPP in Windows firewall did the trick for me. Now loads instantly.
Upvotes: 1
Reputation: 491
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...
...follow these steps to do so:
This really works for me after a very long time-consuming web search with no luck at all. I hope it helps.
Upvotes: 32
Reputation: 21
How about disabling LoadModule cgi_module modules/mod_cgi.so
in httpd.config
. It might speed up your loading page.
Upvotes: 2
Reputation: 77
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 ;)
Upvotes: 1
Reputation: 131
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.
Upvotes: 8
Reputation: 66
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.
Upvotes: 1