Working with WordPress on a local machine can be frustrating if you frequently use more than one computer.
I’ve seen a few blog posts where developers will set up two MAMP instances and then sync their database files with Dropbox so they can access the same database file on both machines. This is tricky to set up and can easily lead to corupted database files.
Instead of using the MAMP provided local database, I use a database on my web host account and store all the WordPress files in DropBox. Here are the steps:
1. Install MAMP on both machines.
2. Once MAMP is set up, go to MAMP Preferences -> Apache and change document root to your Dropbox folder or a Dropbox subfolder. For me it’s: /Users/Kevin/Dropbox
3. Ensure you change this setting on both machines
4. Now create a database on your hosting account (I use Bluehost).
5. Be sure to enable remote access to MySQL. If you’re using a shared hosting account and cPanel, click on Remote MySQL
1. Download WordPress and unzip it
2. Place the unzipped WordPress folder in your Dropbox folder
3. Start MAMP
4. Go to: http://localhost:8888/ (This may be different if you changed your default MAMP port settings)
5. Click on the WordPress folder
6. You should get the following WordPress wpconfig.php setup screen:
Create WordPress wpconfig.php file
7. Now create the wpconfig.php file. The tricky part is figuring out the correct credentials for remote login to your hosted server. Here is an example if you’re using BlueHost:
8. If you’re using a shared hosting account, you may need to prefix your database name and username with your username. When you create your database and users from your cPanel, you should see something like: username_databasename. For example: kcm_wp1
Your username would then be something like: kcm_user1
And you may need to use an IP address in the Database Host
The only downside to this arrangement is that it’s not quite as fast as a local database.
If this post seems like gibberish and you just want to figure out how to run WordPress on your computer, check out this post: . If that doesn’t make any sense, leave a comment and let me know how I can help you.
It’s really good practice to install multiple instances of WordPress on your local machine using different scenarios. It makes the real life installation second nature.