WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Any experts here who run WordPress on localhost? (16 posts)

  1. Bliss7
    Member
    Posted 6 years ago #

    Hmm, I just downloaded a WAMP stack called XAMPP, but I still cannot replicate my blog on my PC...

    I downloaded my blog database and I changed the WP-config.php to be same with the real one online, but still it cant.

    A few issues why may be these below: -->

    My online blog has:

    - database name of "myhostingusername_mydatabasename"
    - username of "myhostingusername_mysqlusername"

    As you can see, these are PREFIXED with my hosting user name.

    As for the localhost, it doesnt have those prefixed usernames. But it can run partially if I just copied the names from the config file like below :

    - database name of "mydatabasename"
    - username of "mysqlusername"

    Now it can run partially, because I think the database has all my real live URLs inside the database. So the WP is always trying to access the live site instead of running under... http://localhost/etc...

    What should I edit in the database copy that I downloaded from my site and (have already imported into PHP MyAdmin)?

    I think it must be something to change the urls in there to reflect http://localhost/foldername..etc

    Do you know how, to replicate your blog on localhost?

    Regards,

    Bliss7

  2. Bliss7
    Member
    Posted 6 years ago #

    Have already managed to get my blog working, but there's a problem, none of the links in the sidebar like archive/recent posts work.

    All I did was change all instances of my old blog url in the database from http://www.myblogname.com to http://localhost/myfoldername

    in a text editor...

    and it works...only for the front or root page. All the archives and recent posts that now are supposed to run with the new path http://localhost/myfoldername/category/postname/...etc

    doesnt seem to work on my blog replica!

    Basically, anything beyond...http://localhost/myfoldername/

    does not work.

    I have enabled /%categories%/%postname%/ in the permalinks for the test blog, and there was no problem with that. Am using XAMPP.

  3. moshu
    Member
    Posted 6 years ago #

    What is in your wp-options table in the "home" and "site_url" rows? In other words: if you can log in - what are the two URI values in admin > Options > General?

  4. Bliss7
    Member
    Posted 6 years ago #

    The two values are just exactly as I have changed them (when I was changing the database values with text editor) using search and replace.

    It shows http://localhost/myfoldername for both blog url and site url (inside the WP-Options).

    So, it should have worked... Mousing over all the recent post links in the sidebar will show the url as http://localhost/myfoldername/category/postname

    but when I click to test...I get 404 error page.

  5. moshu
    Member
    Posted 6 years ago #

    Permalinks? mod_rewrite?

  6. BCKing
    Member
    Posted 6 years ago #

    Xampp works great as on a usb stick to take your development environment with you. Have you checked Options/Wordpress address (URL) and Options/Blog Address (URL)

  7. IcelandDream
    Member
    Posted 6 years ago #

    I like putting in a full hostname instead of localhost. Then it works on the network if I need it to. A dummy host/domain name works fine if you can run a local DNS (or use a hosts file or a modern router that can do specific resolution and anyone connected works as it should)

  8. Bliss7
    Member
    Posted 6 years ago #

    I think XAMPP doesnt need a mod_rewrite does it? I found it worked out of the box, meaning I could change the permalinks to default, date based, or custom permalinks...

    It will tell me my settings have been saved...etc

    But the only permalink that the links will work with once I have transported my blog to my localhost is the default permalink structure.

    In WordPress options, it already shows the blog url as http://localhost/myfoldername

    So only "default" or the "ugly" permalink stucture works. As for the other types.. (nope).

    Something to do with the XAMPP settings and mod_rewrite I think...But the XAMPP looks ok and everything in the WordPress admin looks ok!

  9. moshu
    Member
    Posted 6 years ago #

    Well, I needed to "turn on" the mod_rewrite.
    See at the bottom of the tutorial:
    http://www.tamba2.org.uk/wordpress/xampp/

  10. shezzuk1
    Member
    Posted 6 years ago #

    Hmm, I have this same problem on localhost. Tried enabling mod rewrite and now it just jumps to the xampp splash screen. Any ideas anyone?

    http://www.dutchnewz.com

  11. winston101
    Member
    Posted 6 years ago #

    Hi.

    I'm pretty new to WordPress and I'm attempting to do what you guys seem to be trying to do.

    I take it that you have copied all the WordPress files from your 'wordpress' directory on your webhost onto your localhost before trying any of the stuff mentioned above?

    I'm just trying to weigh up whether it's worth doing all this stuff. Downloading all the files and changing all the references to my webhost within my WordPress database to reference my localhost instead of just using ftp because surely I'll have to change all the references back when i put it live.

  12. shezzuk1
    Member
    Posted 6 years ago #

    finally got mine to work by changing the url type back to the bog standard one, ie not the title of the post as a url

  13. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    I use a copy of XAMPP Lite for testing on my local machine. It works okay. Few minor tips:
    1. After uncompressing XAMPP Lite to a directory, you need to run the setup batch script to make it work properly.
    2. You need to find Apache's httpd.conf file and enable the rewrite module by removing the # in front of that line. Then pretty permalinks will work.
    3. I prefer to put a copy of WordPress into a "wp" directory under htdocs. This way I keep the xampp default stuff and can test wp separately. I usually am using SVN, so it makes it easier to update too.
    4. For posts and such, don't try to copy the database directly. Use the Export on your blog and Import into the new local blog. Simpler.

  14. winston101
    Member
    Posted 6 years ago #

    To: Otto42

    Cheers. I'm using XAMPP as well.

    Just a couple of questions. What do you mean by SVN? And also i take it that exporting from my webhost wordpress will mean i can tell it where to export to i.e. my localhost version?

    Thanks.

  15. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

  16. winston101
    Member
    Posted 6 years ago #

    Mine is up and running now. I simpley ftp'd my 'wordpress' directory from my webspace into the 'htdocs' directory of XAMPP and then followed the steps on this page which is mentioned above:
    http://www.tamba2.org.uk/wordpress/xampp/

    It's probably just as easy to download WordPress as it is to copy the folders from your webspace because you still have to install it on your localhost and then use the export facility on your live blog to get all your posts etc onto your local version.

    The export facility is found at: /wordpress/wp-admin/export.php
    on your webspace.

    Hope that's of help to anyone who is still stuck or anyone who finds this thread.

    p.s. I'm not too sure what this 'permalink' stuff is about but all the links to my categories and posts etc seem to work just fine.

Topic Closed

This topic has been closed to new replies.

About this Topic