Page 1 of 1
Word Press expert needed: local hosted points to live...
Posted: Fri Aug 15, 2014 5:32 am
by simonmlewis
We have copied the database of a hosted Word Press site, and all it's data, top our local machine.
We can only it ok, but when we visit wp-admin, it redirects us to the www version, not the site.local version.
Where is the local settings in the labyrinth of files, to stop it doing that?
Re: Word Press expert needed: local hosted points to live...
Posted: Fri Aug 15, 2014 6:09 am
by Celauran
WordPress stores absolute URLs in the database. It's pretty insane. Open up your wp-config.php and paste the following into it:
Code: Select all
define('WP_HOME', 'http://example.com');
define('WP_SITEURL', 'http://example.com');
(obviously substituting your local URL for example.com)
Re: Word Press expert needed: local hosted points to live...
Posted: Fri Aug 15, 2014 6:15 am
by simonmlewis
Bingo, I'm getting this tho:
[text]Warning: include_once(C:\xampp\phpMyAdmin\site/wp-content/plugins/easy-media-gallery-pro/includes/functions/functions.php): failed to open stream: No such file or directory in C:\xampp\phpMyAdmin\site\wp-content\plugins\easy-media-gallery-pro\easy-media-gallery-pro.php on line 426
[/text]
I assume it's a plugin, but whu would that not be working? Missing file (even tho I copied it all over)
Re: Word Press expert needed: local hosted points to live...
Posted: Fri Aug 15, 2014 6:19 am
by Celauran
Could it have something to do with the mix of backslashes and slashes in the include statement? I don't really work with Windows, so this isn't something I've encountered.
Re: Word Press expert needed: local hosted points to live...
Posted: Fri Aug 15, 2014 6:32 am
by simonmlewis
Sorted it. Even tho I copied it all.... it didn't copy all.
Thanks.
Re: Word Press expert needed: local hosted points to live...
Posted: Wed Oct 01, 2014 3:40 am
by simonmlewis
Hi.
Got similar issue with the same site now, as we are moving it over to a new host.
This is the code, but we are getting "Error Establishing a Database connection". I know the DB connection credentials are correct.
Code: Select all
// disable redirect
define('WP_HOME', 'http://www.site.com.34spreview.com/');
define('WP_SITEURL', 'http://www.site.com.34spreview.com/');
define('DB_NAME', 'databasename');
/** MySQL database username */
define('DB_USER', 'correctuser');
/** MySQL database password */
define('DB_PASSWORD', 'PASSHERE');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
It's using a preview domain with our hosts, maybe that's a cause, but we need to test it in preview first.
Re: Word Press expert needed: local hosted points to live...
Posted: Wed Oct 01, 2014 7:19 am
by Celauran
Nothing we can glean from that snippet of code, though the URLs look a little odd. yoursite.34spreview.com suggests it's on another domain entirely, which could be a different physical box, different set up, etc. Impossible to tell. I'd talk to your hosting providers about it. Ignoring WP, are you able to establish a DB connection on the preview host? Either via the CLI or through some other PHP script? At least that will help you identify where the problem lies.
Re: Word Press expert needed: local hosted points to live...
Posted: Wed Oct 01, 2014 8:01 am
by simonmlewis
We have worked it out - the hosts spotted a slight error in the database name, something I don't think I would have seen if I looked and looked.