LS_
LS_

Reputation: 7129

Cannot get a wordpress site to run on a local machine

I'm trying to wrok locally on a wordpress site, I've already set up Wamp server, I've exported the DB and edited the wp-config.php in order to use the local DB, the problem is that when I open the site I can see the theme loaded correctly but the content of the pages doesn't load instead I get a "404 Error - no page here". On the console I get some warnings and just one error:

POST http://localhost/mysite/wp-admin/admin-ajax.php 404 (Not Found)

It's trying to locate the admin-ajax.php file but it's missing a folder between mysite and wp-admin, is there a way to fix this problem or do I need to find where the admin-ajax.php file is required and edit the path?

Upvotes: 0

Views: 145

Answers (5)

carltonstith
carltonstith

Reputation: 154

Use RazorSQL or MySQL Workbench to do a find and replace for the URL's (live vs local).

Upvotes: 0

DpEN
DpEN

Reputation: 4364

Try running these queries in SQL Tab. Replace "existing_site_url" with your existing site url that is site_url row and replace with your new URL

UPDATE wp_options SET option_value = replace(option_value, 'existing_site_url', 'new_url');

UPDATE wp_posts SET guid = replace(guid, 'existing_site_url', 'new_url');

UPDATE wp_posts SET post_content = replace(post_content, 'existing_site_url', 'new_url');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'existing_site_url','new_url');

This should do the trick.

Upvotes: 0

Technoh
Technoh

Reputation: 1600

Since your have exported/imported your database I believe the site's URL and the server's file structure have changed. If that is the case, you will need to download a tool such as Interconnectit's database search and replace script. You need to put the files in the root folder of your wordpress installation and then access it.

If you don't still have the export I suggest you make a backup of your database before using the tool, just in case.

Important: remember to delete the files once you are done using the renaming tool.

Upvotes: 1

StevenV
StevenV

Reputation: 106

Move to VVV Worpress, is better than WAMP. WAMP lacks of many features, and will not allow to debug accordingly.

Upvotes: 0

Rizwaan
Rizwaan

Reputation: 29

in wamp some changes may need to do. please follow as:

left click wampmanager -> Apache -> httpd.conf This will open that file in notepad and you can locate the line

LoadModule rewrite_module modules/mod_rewrite.so

Remove # from starting text if present. Restart wamp

and set/save permalink once

Upvotes: 0

Related Questions