Copy wordpress to local host?

I have a simple (only 2 posts and no pages) test WP blog installed on a remote web host. I’m trying to work on a copy of it off-line on my localhost. I started by adding a new wordpress to my local host, then copied the wp-include folder from remote host to the new localhost wordpress. Export/Import databse. Start and install WP and follow steps to create config.php file.

All works as should. Blog appears on localhost with the 2 posts and the theme appearance and etc just as it does on remote host.

Problem - When, in the WP dashboard Posts section, I click on “view” post I get page not found error 404. I have been advised that I need to go to Settings>Permalinks and then click save. As soon as I select Settings>Permalinks a .htaccess file is added to the WP on localhost, the dashboard display becomes not correct and if I click save I get server error 500 message. From that point on I cannot access the blog on localhost at all. If I delete the .htaccess file I get back to where everything works except as described at the top of this post.

So I believe I need to configure the .htaccess file and/or possibly some other configuration settings I need to change. I just can’t figure out what I need to do to get this working correctly. A link to the .htaccess files is below. One file from original remote host the other created by WP when I go to Settings>Permalinks

http://www.openrangeimaging.com/Test/htacess.jpg

someone suggested to me that I just work on my localhost without the .htaccess file but that doesn’t seem right to me and I want to get this sorted out and working 100% correctly.

Any advice on how I might get this resolved will be very much appreciated

What is your local setup? If you are using something like MAMP or XAMPP, you can set up the local environment to match the remote environment (in terms of URLs etc.) which might make this easier.

Hi Ralph,

thanks for your reply! I am using XAMPP. I do have a different url naming between remote and local folders. On the remote host the WP files are all in a folder under the root called “blog”. On my local install I have XAMPP under the C: drive. I have the folder with the WP files “prospect-blog-test”. That folder is under xampp/htdocs/xampp (that seems to be the default location for everything runnig on the xampp.).

If I understand you correctly I wold rename my local install folder “blog” to match the remote install?

Thanks again for your help!

In MAMP, you can change the location of the files, so I assume you can do that in XAMPP as well. For MAMP, I use these instructions to change my setup so that it mimics the online version:

http://foundationphp.com/tutorials/vhosts_mamp.php

I think these are the equivalent tips for Windows:

http://foundationphp.com/tutorials/apache22_vhosts.php

Hope that helps!

thank you ralph! I’m going to go thru the info on the link you provided and see if I can get this working.

OK I tried following the instructions in that link as they pertained to xampp. Wow kind of scary. Whatever I did caused my locahost to stop functioning. Fortunately I made backups of the files I edited so I was able to r3estore to the original settings and get the localhost server running again.

This just seems way too difficult. It’s hard to imagine that I would have to go thru all of that to get WP working on my local host. In fact I hae the copied over WP working just fine on localhost. Just cna’t “view” individual posts or enter into the permalink section of the dashboard. The entire issue seems to be tied to .htaccess.

I have another new/fresh WP installed on local host. Not copied over from remote host. New install with one test post and nothing else. Same thing happens. If I go to Settings>Permalinks WP automatically adds a.htaccess file and I get server error and can’t access anything. If I delete the .htaccess file it all comes back and I can access the dashboard and site. Still can’t view individual posts. Can edit posts, can see posts when “visit site”, can’t see individual posts when trying from “visit site” or posts>view post (get object not found error 404).

So the problem is not specific to the WP I copied over from the remote host. It occurs on any wP install I have on localhost. I really wonder how others deal with this. I can’t be the only one with this problem.

I have asked on the WP forum, the Dreamweaver forum and here. You are the only person who has answered. Not sure if that means I’m asking a stupid question or…

Thanks again for your help!

No worries. Sorry to put you through that. Unfortunately, I’m not experienced enough to help more. The only reason I suggested that local setup was so that you wouldn’t have to change any settings (paths etc.) when moving the files online. But I would think that a fresh install on your PC should work fine. As I’m on a Mac, there may be something I don’t know about, so apologies for not being more help.

Often I find that any problem I’ve had has been reported before, so it you aren’t getting answers, Googling can produce some amazing things. For example, if you Google something like “problems using wordpress with xampp” may produce some useful results. (I Googled that myself, and it seemed to produce a lot of interesting links.)

Hope that helps!

Hi markf1,

I’m not sure if I can help or not. But with a fresh install of XAMPP, can you install a fresh WordPress install? So, basically if you download WordPress and install it without making any changes, can you get it to work?

thanks for your reply! yes I can and do have XAMPP and WP working correctly and if I do a fresh install of WP it works correctly , except for the pemalinks and associated htaccess issue mentioned above.

Like I said, there’s lots you can Google on this, such as

Thanks Ralph! I have searched on Google and read lots of info. That link you provided looked hopeful and I did not find that in my Google search. Unfortunately the httpd.conf file that I have is not the same as referenced in that link.

The # referenced in the first part of the instructions is removed by default in my setup. The AllowOveride all is also set up as described in the link. So I have the httpd.conf file just as is specified in the link , but no go…

thanks again Ralph. there is some little glitch, I suspect I do need to make some edit in the httpd.conf file. and perhaps some other core apache files. what that may be is not easy to figure out.