0

I install wordpress on localhost then install wordpress on hosting. I want to access remote database on hosting from localhost environment. so whenever we add new page or post or change configuration it's has been set on hosting database, so we can make team work enviroment very well.

We use SVN and install it on hosting already and need remote database so every member can change configuration on Wordpress Administration Panel and other developer get latest configuration from remote database.

I try change wp-config.php to access remote database and it's work but whenever access frontend site on localhost it always redirect to actual website on hosting. I want to see frontend site on localhost with remote database.

I already check this on wordpress support and get this topic article, he ask it five years ago maybe now it's possible.

Could it possible ?

I need sync files and sync data using remote database so every developer can look the same website from functionality and data. every developer can insert / update / delete post or page and other developers get it too. We can't work with just sync files and have to insert data on hosting database later. We need sync files and data so we just upload files later after our work is finish.

1

WordPress stores site url and home url in database. And it can have only one value.

The easiest way to do it, would be to change these options to localhost address. If you do so, you will be able to work on this WordPress on localhost, but remote installation won't work (it will redirect you to localhost).

Another way to do this, is to fake DNSs response and set this domain to point on your localhost. You can do this by editing etc/hosts file, and then setting virtual host on your apache server.

I prefer second solution. WordPress will still work on remote server, and by editing etc/hosts file I can quickly change which WordPress will I see.

  • yeah I know wordpress save store url when process installation but we want to access remote dbase. I try to set block url of actual website but it will display localhost environment ( use XAMPP ). maybe there's someone can cheat on this system. It very useful for teamwork environment so data who received another developer it's same like each other who work / modify it together, it's sounds awesome. – Joko Wandiro Jul 4 '13 at 8:31
  • @JokoWandiro: Did you read rest of my answer? I give you 2 solutions... Each one of them will do exactly what you want. – Krzysiek Dróżdż Jul 4 '13 at 8:55
  • your first solution is change options url to localhost on database hosting or database localhost. I assume it to change on database hosting, right ? If I do it when I use Panel Administration on localhost could it insert / update new data to database hosting. – Joko Wandiro Jul 4 '13 at 9:19
  • OK, let's make it clear. In both cases you have only one, remote database (on your remote server) and you connect all WordPresses to it. Since you have only one DB, then all changes are stored in it... The only thing you have to do is to make siteurl work both remotely and locally. You can either set "localhost" as this remote WP instalation or fake remote domain to point to localhost with etc/hosts file. Both solutions have nothing to do with remote DB. – Krzysiek Dróżdż Jul 4 '13 at 9:31
  • I use your second solution. I set vhost and block request to actual website and set wp-config to access remote database and it's work thanks. – Joko Wandiro Jul 4 '13 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.