WordPress.org

Ready to get started?Download WordPress

Forums

xampp localhost too slow - 3 mins (8 posts)

  1. trixienolix
    Member
    Posted 2 years ago #

    I've been using xampp 1.7.3 as a localhost dev server for wordpress sites. I've set up virtual hosting so i can go to http://website1 or http://website2 etc.

    It's been fine but over the last few months has been getting slower and slower and slower.

    Now it takes about 4 minutes to load a page.. that's anything from post > add new in the backend to viewing a page on the front end. It is completely unworkable.

    I've tried all sorts, adding this to my hosts file:

    127.0.0.1 		localhost
    127.0.0.1 		127.0.0.1

    commenting it out, i've just uninstalled xampp and installed xampp lite 1.7.7, I've commented out any unused sites from my hhtpd-vhosts.conf file, I've moved all my sites to a backup folder and only kept the current ones, i've turned off my virus checker and firewall (avast), restarted, restarted xampp services etc etc.

    Having reinstalled to the latest and litest version and still thigns take 3 minutes to load... what can I do next? I now can't use localhost for wp dev which is not good for me.

    Any suggestions?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Have you tried turning virtual hosting off and use sub-folder installs instead?

  3. trixienolix
    Member
    Posted 2 years ago #

    hi esmi, no i've not tried that.. not sure i know how to so will google but if you have any tutorials to hand please post me a url?

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    's really simple. Just run all of your sites in sub-folders off the main root. Then navigate to each site using something like http://localhost/site1 and http://localhost/site2

  5. trixienolix
    Member
    Posted 2 years ago #

    Hi I've moved my website folder into xampp/htpdocs, and I've removed references to virtual hosting in httpd-vhosts.conf AND hosts files... changed the options in wordpress so the new website home is http://localhost/sitename/, same for siteurl.

    When i go to http://localhost/sitename/ I see the homepage of the site fine. However when I click on any links i just get redirected to http://localhost/xampp/ i.e. I can't navigate the site.

    Must be something I've not done properly. CAn you help?

    thanks in advance

  6. trixienolix
    Member
    Posted 2 years ago #

    It seems to be smething to do with the index.php page that is in localhost/htdocs. It has this code in it which forces everything to redirect to localhost/xampp:

    <?php
    	if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
    		$uri = 'https://';
    	} else {
    		$uri = 'http://';
    	}
    	$uri .= $_SERVER['HTTP_HOST'];
    	header('Location: '.$uri.'/xampp/');
    	exit;
    ?>

    How can I change it to stop re-directing? Changin the folder /xampp/ doens't help as it just redirects to a new folder. I want it to use my current folder...

  7. esmi
    Forum Moderator
    Posted 2 years ago #

    Have you tried just renaming the file to index.php.old?

  8. trixienolix
    Member
    Posted 2 years ago #

    hi.. I worked it out:
    I had to rename the index.php file that is in xampp/htdocs, then I made a folder with teh name of my website, copied all of the wordpress files into there. Then logged in to phpmyadmin on localhost and updated the sie url and home to http://localhost/sitename.

    Now i kept getting 404s when trying to view any pag eother than the homepage. This is because of my .htaccess file having been copied from the previous location and now I was expecting it to work in localhost / sitename. So i opened the .htaccess file for my site and deleted all the wordpress code in there. Then I logge din to my admin area and visited th epermalnks apge and update the .htaccess. Then I was able to view all of my website. Hurrah!

    So, back to the original problem. Having subfolders like this has made my xampp work lovely again. This implies that the reason the pages were taking 4 minutes each to load is something to do with virtual hosting.

    Does anyone have any suggestions as to how to mend my setup so I can go back to virtual hosting? At least now I can work so many thanks Esmi... just want to know what was going on before if possible.

Topic Closed

This topic has been closed to new replies.

About this Topic