WordPress Development and Deployment With MAMP, Git and Dropbox

WordPress Development and Deployment With MAMP, Git and Dropbox

Tutorial Details
  • Program: WordPress, Git, MAMP, Dropbox
  • Difficulty: Difficult
  • Estimated Completion Time: Varies

Nowadays in order to be a freelance WordPress developer you often need to develop simultaneously several WordPress sites for different clients. Here’s how.

This requires you to adopt the following:

  • A flexible local development environment that allows you to easily add a new site, with a modern Version Control System and that allows you to develop both on your desktop computer and on your notebook.
  • A reliable and secure deployment system to the remote server.

With this setup you can easily:

  • locally develop and test your new plugin or theme in a safe way and deploy it to the production server;
  • locally update the WordPress core files or update already installed plugins/themes in a safe way, check that nothing breaks the site and deploy this changes to the production server;
  • make quick changes on some files on the remote server and then fetch them on the local environment.

Before We Begin

In this tutorial we refer to Mac OS X but you can easily adapt it to any other OS. Additionally we assume that the remote server has Git already installed and SSH access configured with public key authentication (the SSH and Git installations are out of the scope of this tutorial).

The scenario that we will see consists of a Local Environment that allows the development of a WordPress site with plugins and themes and a Remote Server that will host the “production” WordPress site. In the Local Environment we will use a Desktop computer and a Notebook computer. On both computers we will setup MAMP, Dropbox and Git so that you can work on your Desktop when you are in the office and on your Notebook when you are not in the office and all changes will be synchronized.

We will use Dropbox to synchronize files and DB between Desktop and Notebook, and we will use Git to track changes locally and to deploy them to the Remote Server.

For simplicity we define www.site.dev as the development site on the Local Environment and www.site.com as the production site on the Remote Server.


What We Will Do

On the local environment:

  • create a basic directory structure on Dropbox;
  • install and setup MAMP (both on your Desktop and your Notebook) to work in a Dropbox environment;
  • setup and run WordPress development sites on both your Desktop and your Notebook;

On the remote server:

  • configure Git, setup the remote repository and the necessary hook;
  • setup MySQL for the WordPress production site;

On the local environment:

  • configure Git, setup the local repository;
  • modify the WordPress configuration to manage local/remote DB connection;
  • make the initial commit and the first deploy to remote server.

Typical workflow examples:

  • theme/plugin development;
  • WordPress management;
  • acknowledge “urgent-on-the-fly” changes on the production server and pull them in the local environment;

What You Need

  • On the Local Environment:
    • A Dropbox account, an installed Dropbox client both on your desktop and notebook (see Dropbox website for installation instructions);
    • MAMP, you can get it from here;
    • Your favorite Text Editor;
    • Git (how to install Git locally is covered in the Pro Git book);
  • On the Remote Server:
    • PHP and MySQL as per WordPress requirements;
    • Git installed (see here);
    • An account with SSH access and public key authentication;

Step 1 Create Directory Structure on Dropbox

Download and install Dropbox on your Desktop and your Notebook (see here for instructions). Use the same account on both computers.

In the Dropbox folder on Desktop, create the following directory structure:

  • Dropbox
    • Development
      • conf
      • db
      • logs
      • vhost
Development

Check that the same directory structure is propagated on Notebook.


Step 2 Install and Configure MAMP

MAMP is an acronym that stands for: Mac, Apache, MySQL and PHP, it is an application that installs a local server environment on your Mac.

Its installation is very easy: download MAMP from here, unzip the archive and double-click it, then follow the instructions. Do this on both Desktop and Notebook. Don’t start MAMP yet: before doing this you have to move the database and modify the default configuration.

Move the Database Folder

On Desktop move database folder from MAMP standard location to db directory on Dropbox, to do this open a Terminal and use the following commands:

cd /Applications/MAMP/db
mv * ~/Dropbox/Development/db/

On Notebook open a Terminal and delete the database folder using the following command:

cd /Applications/MAMP
rm -rf ./db

Lastly on both Desktop and Notebook create a symbolic link from MAMP to Dropbox with the following command:

ln -s ~/Dropbox/Development/db /Applications/MAMP/db

Now the symbolic link /Applications/MAMP/db points to the Dropbox shared folder ~/Dropbox/Development/db that contains the MAMP Databases. Don’t start MAMP yet: we must first make a change to the configuration.

Change MAMP Ports

MAMP uses custom ports for Apache and MySQL server instances: Apache runs on port 8888, MySQL runs on port 8889. You can maintain this configuration or, as we suggest, change it to use standard ports: 80 for Apache, and 3306 for MySQL.

To restore standard ports, start MAMP on your Desktop only , click on “Preferences…”, then on “Ports”, click “Set to default Apache and MySQL ports” and finally click on “OK”: MAMP saves the new configuration and restarts automatically.

MAMP Ports

Now on your Desktop open your favorite browser and go to http://localhost/MAMP/: you should see the MAMP Home Page.

MAMP Homepage

If you don’t see the MAMP Home Page probably you have Web Sharing enabled: open the System Preferences, click on Sharing and turn Web Sharing off.

Web Sharing

Don’t worry if Mac OS X requires a password when you start MAMP: we have setup Apache to run on port 80 that is a privileged port and this requires an administrator password.

Because in this configuration MAMP can’t run simultaneously on both your Desktop and your Notebook, quit MAMP on Desktop, start it on Notebook and configure it in the same way. When you finish stop MAMP.

Change MAMP – Apache Configuration

MAMP Apache configuration is stored in /Applications/MAMP/conf/apache/httpd.conf. Edit this file with your favorite text editor and append the following lines (do this on both your Desktop and your Notebook):

# Includes the configuration shared on Dropbox folder
Include /Users/YOURUSERNAME/Dropbox/Development/conf/local-development.conf

Replace YOURUSERNAME with your Mac OS X username (if you don’t know it open Terminal and run whoami; it will provide you with your username).

This statement instructs Apache to load an additional configuration file from your Dropbox folder (synchronized between Desktop and Notebook). In this way we can use it as the Local Environment Configuration File.

Setup Apache Virtual Host on MAMP

Apache Virtual Host is a nice feature that allows you to run more than one web site (such as www.site1.com and www.site2.com) on a single server. Virtual hosts can be “IP-based”, meaning that you have a different IP address for every web site, or “name-based”, meaning that you have multiple names running on one IP address. The last one is the feature that we will use (see here for details).

With your favorite text editor open the Local Environment Configuration File /Users/YOURUSERNAME/Dropbox/Development/conf/local-development.conf and insert the following lines:

<Directory "/Users/YOURUSERNAME/Dropbox/Development/vhosts/">
AllowOverride All
</Directory>

# 
# Named Virtual Host
# 
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog /Users/YOURUSERNAME/Dropbox/Development/logs/access.log vcommon
ErrorLog /Users/YOURUSERNAME/Dropbox/Development/logs/errors.log
UseCanonicalName Off
VirtualDocumentRoot /Users/YOURUSERNAME/Dropbox/Development/vhosts/%0

The string “%0” casts the spell: when the Apache server receives a request for the domain www.site.dev it looks for a directory named www.site.dev in /Users/YOURUSERNAME/Dropbox/Development/vhosts/, and if found serves files from it.

The other statements instruct Apache where to write error and access log files.


Step 3 Setup WordPress

Now we are ready to setup the WordPress development site www.site.dev. In order to do this we have to create a www.site.dev directory (on your Desktop).

www.site.dev

and we have to edit (on both Desktop and Notebook) /etc/hosts file to map the hostname www.site.dev to the localhost IP Address. With your favorite text editor open the file /etc/hosts and append the following lines to the end of file (Mac OS X requires your password to modify this system file):

# local development
127.0.0.1	www.site.dev

At this stage it might be useful to do some check: open Terminal and run the following command:

ping -c 3 www.site.dev

You should have a similar response to this:

Terminal

It’s now time to set up WordPress: Download the WordPress package from here and unzip in a temporary folder. Move all the content of the temporary folder inside /Users/YOURUSERNAME/Dropbox/Development/vhosts/www.site.dev/.

On your Desktop start MAMP and open your browser at http://localhost/MAMP/. Click on the phpMyAdmin tab and create a new database named site_dev:

MAMP - phpMyAdmin

Open your browser at www.site.dev and complete the WordPress installation using these values:

  • Database name: site_dev
  • User name: root
  • Password: root
  • Database host: localhost
  • Table prefix: wp_

Stop MAMP on the Desktop, wait for Dropbox synchronization and start it on Notebook. Open your Notebook Browser at www.site.dev: WordPress is already configured!

At the end of Step 3 we have a local WordPress development environment based on MAMP and synchronized between Desktop and Notebook via Dropbox, now it’s time to configure the remote server.


Step 4 Configure Git on the Remote Server

Git is a Distribuited Version Control System, that records changes to a file or set of files over time and allows pushing changes to a remote server (more detailed description here). In this tutorial we assume that Git is already installed on your server. Accordingly, we proceed with the configuration.

First you have to login to the server. We assume you have an account with SSH access and public key authentication. In this way you don’t have to insert a password every time you login. Open a terminal window and connect to the server:

ssh yourusername@www.site.com

Setup some Git defaults about user and email to avoid Git asking for them every time:

git config --global user.email "youremail@site.com"
git config --global user.name "Your Name"

Setup and initialize an empty repository:

mkdir site.git
cd site.git
git init --bare

In order to allow the deployment from development to production site you have to setup a Git hook (I use Vi as my text editor for the remote server):

cd hooks
vi post-receive

Then insert the following lines:

#!/bin/bash
#
docroot="/home/yourusername/www"
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`

if [ "master" == "$branch" ]; then
git --work-tree=$docroot checkout -f $branch
fi

done

Set the variable docroot to the Web Server DocumentRoot and then make post-receive executable:

chmod 755 post-receive

This Hook is invoked at the end of the process of pushing changes from a client (Desktop or Notebook) to the Remote Server. It makes the deployment to the production Web Server DocumentRoot directory (see here for details about Git Hooks).

Git commands use some environmental variables; we need to setup two of them: GIT_DIR and GIT_WORK_TREE. The first specifies the path to repository, the second the path to the working tree (the DocumentRoot). The default shell on my Remote Server is Bash so I add them to the file .bash_profile.

cd ~
vi .bash_profile

Add the following lines to the end of file:

# GIT
export GIT_DIR=~/repo.git
export GIT_WORK_TREE=~/www

Step 5 Setup MySQL on Remote Server

On the Remote Server you still have to create a Database on MySQL: to do this you can follow the Detailed Installation Instructions on the WordPress Codex. My remote server has cPanel as hosting control panel so I follow these instructions.


Step 6 Setup Git on the Local Environment

Install Git on Mac OS X (more detailed instructions on Pro Git book): download the installer from the Google Code page, double-click the dmg file then the pkg file and follow the instructions. Do this on both Desktop and Notebook.

Now you are ready to initialize a Git repository on the Local Environment. To do this open Terminal (on your Desktop or on your Notebook) and use the following commands:

cd ~/Dropbox/Development/vhost/www.site.dev
git init .

You should see something like this:

Git init

To check the status of the Git repository use this command:

git status

the output should be like this:

Git status

Git is telling you that all these files and directories are not tracked in the repository and suggests to use the git add command to track them.

Before doing this you need to make some changes on the Git configuration. We must tell Git which files it should track and which it shouldn’t. To do this use the .gitignore file.

The .gitignore File

This file specifies the untracked files that Git should ignore (see here for more details). The command is simple, let’s make an example to understand how it works:

# ignore Mac OS X Desktop Service Store
.DS_Store

# ignore my-test-dir directory and all subdirectories
my-test-dir/

#ignore all .txt files
*.txt

So create the file ~/Dropbox/Development/vhost/www.site.dev/.gitignore and add the following lines:

# ignore Mac OS X Desktop Service Store
.DS_Store
# ignore debug.log
wp-content/debug.log

For the moment this is all you need to do. Later on we will add other files and directories.


Step 7 Modify WordPress Configuration to Manage Local and Remote DB Connections

WordPress on a Local Environment uses DB from MAMP and its configuration file wp-config.php reflects this configuration (standard MAMP MySQL username and password):

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'site_dev');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'root');

/** MySQL hostname */
define('DB_HOST', 'localhost');

This works on a Local Environment but what happens if we deploy it to the Remote Server? Obviously it will fail to connect to the DB because DB_NAME, DB_USER, DB_PASSWORD and probably DB_HOST are wrong.

The solution comes from Mark Jaquith’s article: modify the wp-config.php file so that configuration for Local Environment is loaded from another file and that file is not tracked by git. To do this open up wp-config.php file and substitute the above lines with these lines:

if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) {
	include( dirname( __FILE__ ) . '/local-config.php' );
}
else {
	define('DB_NAME', 'YOURDBNAME');
	define('DB_USER', 'YOURDBUSER');
	define('DB_PASSWORD', 'YOURDBPASSWORD');
	define('DB_HOST', 'YOURDBHOSTNAME');
}

Replace YOURDBNAME, YOURDBUSER, YOURDBPASSWORD and YOURDBHOSTNAME with the values that you defined in Step 5.

Create the ~/Dropbox/Development/vhost/www.site.dev/local-config.php file and put the Local Environment’s defines in there:

define('DB_NAME', 'site_dev');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_HOST', 'localhost');

Now we have to add local-config.php to .gitignore so that Git will not track it:

# ignore Mac OS X Desktop Service Store
.DS_Store
# ignore debug.log
wp-content/debug.log
# ignore local-config.php
local-config.php

OK, now we are ready to make the first commit.


Step 8 Commit Changes on Local Environment and Push Them on Remote Server

To commit changes to Git repository on Local Environment enter these commands:

cd ~/Dropbox/Development/vhost/www.site.dev/
git add .
git commit -m "Initial import"

The first Git command tracks all files and directories in ~/Dropbox/Development/vhost/www.site.dev/ except that in .gitignore, the second one commits all of them in the Git repository.

It’s time to push WordPress on Remote Server, but first we have to setup the remote Git repository:

git remote add website ssh://yourusername@www.site.com/home/yourusername/site.git

This command tells Git that there is a remote repository called website, hosted on server www.site.com accessible through an SSH connection.

Finally the first deploy on Remote server:

git push website master

The command’s output should looks like the following:

git push

Now you can point your browser to www.site.com and see WordPress site on Remote Server.


Some Examples of Typical Workflows

Theme/Plugin Development

As theme/plugin development example we can create on the Local Environment a Twenty Eleven child theme and deploy it to the Remote Server.

For a detailed instruction on how to create a child theme you can read this article on Wptuts+. Basically we have to create a directory that contains two files: style.css and functions.php (the latter is optional).

So on Desktop (or on Notebook) create the directory ~/Dropbox/Development/vhost/www.site.dev/wp-content/themes/my-twentyeleven-child, then create a file called style.css inside this folder and add the following lines:

/*
Theme Name:     My Twenty Eleven Child
Theme URI:      http: //www.site.com/
Description:    Child theme for the Twenty Eleven theme
Author:         Your Name
Author URI:     http: //your-site.com/
Template:       twentyeleven
Version:        0.1
*/

@import url("../twentyeleven/style.css");

You can also add some CSS changes under the @import line, for example you can change body background:

body {background: #D51717;}

Then create the functions.php file and add the following lines:

<?php
function favicon_link() {
	echo '<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" --="" />' . "\n";
}
add_action('wp_head', 'favicon_link');
?>

This simple function file does one thing: it adds a favicon link to the head element of HTML pages.

Now our child theme is complete and we need to track it in Git repository:

cd ~/Dropbox/Development/vhost/www.site.dev/
git add wp-content/theme/my-twentyeleven-child/

Then we need to commit the changes:

git commit -m "Added My Twenty Eleven Child Theme"

In this this way you can continue the development of the child theme adding files, changing code and committing all these changes to repository. When your theme is ready for the production server you simply have to issue the git push command:

git push website master

In this way the child theme will be pushed on the Remote Server, ready to be used.

If you develop a plugin do the same steps: track the plugin directory and commit changes on repository. When your plugin is ready push it on Remote Server.

WordPress Management

In a similar way we can manage WordPress plugin installation or WordPress update. Let’s assume that we want to try a new plugin, and we want to be sure that it doesn’t break our production site.

We install it on Local Environment first using the WordPress Administration Panel (see here for details), then we have to track it and add it to Git repository (do this on your Desktop or on your Notebook):

cd ~/Dropbox/Development/vhost/www.site.dev/
git add wp-content/plugins/plugin-to-try/
git commit -m "Add the Plugin to try"

If the plugin works, you can deploy it on Remote Server using:

git push website master

and enable it using the WordPress Administration Panel.

If plugin doesn’t work you can uninstall it using the WordPress Administration Panel, then you can remove it from tracked files and commit the changes:

git rm wp-content/plugins/plugin-to-try/
git commit -m "Removed the Plugin to try"

A little tip: if you add a plugin directory to .gitignore file (before commit) the plugin will remain only on the Local Environment but it will not pushed on Remote Server. This might be useful for plugins like Debug Bar that are used in local development but that don’t have to be transferred to a production site.

Make Quick Changes on the Production Server and Pull Them in the Local Environment

Ok, we know, quick changes on production server are not a good habit, indeed they are a bad habit, but sometimes are unavoidable. Assuming that we changed the DB_PASSWORD on Remote Server wp-config.php file and now we want to acknowledge that change in our Local Enviroment wp-config.php. To do this first connect to remote server via SSH and use the following command:

git commit -m "change DB_PASSWORD on wp-config.php"

Then pull changes from remote repository using the following command on Desktop:

git pull website master

If you read the wp-config.php you’ll see the new DB_PASSWORD.


Conclusion

In this tutorial we have seen a scenario made up of a Local Environment and a Remote Server that hosts the development and the production site for www.site.com, but you can easily repeat this setup for www.mynewcustomer.com, for www.myothernewnewcustomer.com and so on.

vhost

MAMP, Dropbox and Git form a winning team to deal with WordPress development and deployment, they represent a flexible development environment that allows to easily add a new site, develop it everywhere you are, and to deploy it in a reliable manner to the production server.

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Pingback: WordPress Development and Deployment With MAMP, Git and Dropbox | Qtiva

  • http://www.leachcreative.com Andrew

    This is a pretty awesome tutorial, thanks for sharing.

  • http://www.LeBlogger.Com Soufiane

    Thanks for this very long but excellent tutorial :)

  • http://www.javipas.com javipas

    Really interesting. I guess working with Nginx on the remote (production) server won’t make any difference if you set the right folders there as well instead of the ones used by Apache.

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi javipas,
      I don’t known enough Ngnix to answer your question, but in principle it should work…

      Bye
      em

  • Don Atkinson

    Just what I’ve been looking for.
    Great stuff. Thank you.

  • Gavin

    not sure why, but you lost me at point 3.

    where do I find etc/hosts? Its not really descriptive as to where I need to go exactly.

    also at point two do I need to create the local-development.conf file myself inside the conf folder or is it suppose to add this automatically. I added it myself but not sure if this is what I was suppose to do.

    • http://cliffseal.com Cliff

      If you’re on OS X, right-click Finder and click ‘Go to Folder…’ and paste in ‘/etc/hosts’ to find it, or type `sudo nano /private/etc/hosts` in Terminal and edit it there.

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Gavin,
      Cliff has already answered your question about /etc/hosts file (grazie Cliff!! :) )

      Regarding local-development.conf yes you have to create it inside the conf folder (/Users/YOURUSERNAME/Dropbox/Development/conf/)

      Regards
      em

      • http://juliangaviria.net Julian Gaviria

        Great stuff Enrico. However you also lost me here and I’m sure you’ve lost a few other readers as well. You never explain to create the local-development.conf file. It would be great if you can go back into the tutorial and make that part a bit more clear for future readers.

        Thanks.

        • http://enricomingardo.com Enrico Mingardo
          Author

          Hi Julian,
          you’re right, my fault.

          To create the local-development.conf file, follow this step:

          open your favorite Text Editor and create a new blank file
          insert the following lines:

          AllowOverride All

          #
          # Named Virtual Host
          #
          LogFormat “%V %h %l %u %t \”%r\” %s %b” vcommon
          CustomLog /Users/YOURUSERNAME/Dropbox/Development/logs/access.log vcommon
          ErrorLog /Users/YOURUSERNAME/Dropbox/Development/logs/errors.log
          UseCanonicalName Off
          VirtualDocumentRoot /Users/YOURUSERNAME/Dropbox/Development/vhosts/%0

          Save this file as:
          /Users/YOURUSERNAME/Dropbox/Development/conf/local-development.conf

          Ciao
          e.

          • http://enricomingardo.com Enrico Mingardo
            Author

            Ooops…
            here is the correct version.

            To create the local-development.conf file, follow this step:

            1- open your favorite Text Editor and create a new blank file

            2- insert the following lines:

            <Directory "/Users/YOURUSERNAME/Dropbox/Development/vhosts/">
            AllowOverride All
            </Directory>

            #
            # Named Virtual Host
            #
            LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
            CustomLog /Users/YOURUSERNAME/Dropbox/Development/logs/access.log vcommon
            ErrorLog /Users/YOURUSERNAME/Dropbox/Development/logs/errors.log
            UseCanonicalName Off
            VirtualDocumentRoot /Users/YOURUSERNAME/Dropbox/Development/vhosts/%0

            3 – Save this file as /Users/YOURUSERNAME/Dropbox/Development/conf/local-development.conf

  • http://www.uckhandla.com/ uck

    This is a pretty awesome tutorial. What’s for WAMP server ?

  • http://solvm.com benjamin

    WOW. This is awesome! Can I get a little clarification on one part.

    You mention that “in this configuration MAMP can’t run simultaneously on both your Desktop and your Notebook.”

    So, after I follow this set up, is it TRUE that I can NOT have MAMP running on my Notebook and Desktop at the same time?

    My bigger concern is being able to share this project in a team environment where everyone can access it at the same time.

    Please advise. AWESOME tutorial! Thank you.

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Benjamin,
      it is true, you can’t, this environment is designed for a single developer.

      bye
      em

  • http://kuznetsof.com Alex Kuznetsof

    Thanks Gavin, wanted to switch from svn to git , not deal with navicat and make us of dropbox for in-house development for a long time. So timely, Cheers!!!

  • http://feryardiant.web.id Fery Wardiyanto

    thanks for the awesome tutorial…
    i’m done on my windows machine using wamp.. ^_^
    but, i have no idea to do it on my linux (ubuntu) machine, it’s about moving database directory… :’(

    anyone have idea???

    • http://hellomynameisjuan.com kilinkis

      try /opt/var/mysql ;)

  • http://pinoyscreencast.net rnovino

    Hope there will be a windows tutorial version for this really an awesome tuts

  • Anders

    I want to have my mac mini as a cloud storage for my sites I develop. Any idea how I do that?

  • http://bfuturedigital.net Susan

    Great tut brings together MAMP, GIT and Dropbox for a nearly seemless workflow. However I would love a method to sync the local and remote databases, I didn’t catch that in the tut.

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Susan,
      i’m working on a reliable method to sync local and remote DBs, i’m starting from http://interconnectit.com/124/search-and-replace-for-wordpress-databases/ but at this time i have nothing useful :(

      Cheers
      em

      • Tri Nguyen

        Please let me know too when you figure this out. I enjoy being able to work on the theme files on my local machine with this method. However, it would be nice too to be able to add pages/ posts right from my local site and have them pushed to the production site.

        • riftman

          One idea for the sync of the database is to use the git hooks. When you push to master dump mysql database, then on master hooks dump server mysql database form backup proposes and them import the mysql dump from the development environment.

  • http://photosbyluiiscamberos.com Luis

    I agree, I windows version of this tutorial would be a great!

  • Pingback: WordPress Plugin SlideDeck Adds Multiple Content Sources And … | Open Knowledge

  • http://ryanscowles.com Ryan

    I’m running into issues when moving the /db/ directory from MAMP’s default location to the Dropbox folder. After moving the directory and creating the link via command line, MAMP can’t seem to connect to the database, and localhost returns the vague “Error: Could not connect to MySQL server!” message.

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Ryan,
      when you moved db, MAMP was stopped?

    • Rory

      I have the same issue. Followed everything up to stage 3. As soon as I restart MAMP the mysql light goes red as you described, its like it cant follow the Symbolic link. Help!

      • Rory

        Actually I found a small error on local-development.conf on the first line it should be ‘vhost’ and not ‘vhosts’. Unfortunately this hasn’t fixed my problem.

        • http://enricomingardo.com Enrico Mingardo
          Author

          Hi Rory,
          “vhosts” in the first line of local-development.conf

          %lt;Directory “/Users/enricomingardo/Dropbox/Development/vhosts/”>

          must match “vhosts” in last line:

          VirtualDocumentRoot /Users/YOURUSERNAME/Dropbox/Development/vhosts/%0

          “vhosts” is the name of the folder inside /Users/YOURUSERNAME/Dropbox/Development that contains all virtual host. I’ve chosen “vhost” but you can use “foo” or “bar” or whatever you want.

          • http://enricomingardo.com Enrico Mingardo
            Author

            I’m sorry,
            previous comment has a couple of error, here is the correct version:

            “vhosts” in the first line of local-development.conf

            <Directory “/Users/enricomingardo/Dropbox/Development/vhosts/”gt;

            must match “vhosts” in last line:

            VirtualDocumentRoot /Users/YOURUSERNAME/Dropbox/Development/vhosts/%0

            “vhosts” is the name of the folder inside /Users/YOURUSERNAME/Dropbox/Development that contains all virtual host. I’ve chosen “vhosts” but you can use “foo” or “bar” or whatever you want.

          • http://www.bakhuys.com Jorn Bakhuys

            What the error is, is that in the beginning you state that the folder “vhost” should be created, and in the local-development.conf file we will refer to a “vhosts” folder.
            Changing the folder name “vhost” to “vhosts” solves the problem.

    • Rory

      I got mine working, the problem was that when you create the Symbolic link from the tutorial you create the reference within the db folder so the path is MAMP/db/db/ rather than MAMP/db/. Just move the Sym Link up a level to rectify it.

      • http://enricomingardo.com Enrico Mingardo
        Author

        Uhm… this is very strange.

        When you create the symlink have you used the command exactly as shown in the tutorial?

        ln -s ~/Dropbox/Development/db /Applications/MAMP/db

        This command should work no matter where you are in the filesystem.

        Ciao
        em

        • http://www.bakhuys.com Jorn Bakhuys

          I think Rory is referring to the location of the Symbolic link that will be created. I have experienced the same problem as Rory.
          It doesn’t matter where you are in the filesystem for the above codeline to work, but the actual Symbolink link will be created inside the folder /Applications/MAMP/db, while the Symbolic link should be created in /Applications/MAMP, so in my experience the following should solve this:

          ln -s ~/Dropbox/Development/db /Applications/MAMP

          • http://ryanscowles.com Ryan

            Thanks for the replies! I tried Jorn’s suggestion for creating the symlink, but MAMP still won’t start the MySQL db.

            My-Computer-Name:~ myusername$ ln -s ~/Dropbox/Development/db /Applications/MAMP
            ln: /Applications/MAMP/db: File exists

          • chrisy

            I did both ln -s ~/Dropbox/Development/db /Applications/MAMP/db and ln -s ~/Dropbox/Development/db /Applications/MAMP , but neither worked. Any idea why? Thanks!!

      • buzz

        Chrisy, just remove the db from the mamp folder and it will be created.

  • http://about.me/ericclark Eric

    While a Windows tutorial would be nice, I think it would be more useful to make this tutorial support both OS X and Windows at the same time. For example, I have two laptops, one Windows and one Mac. Would be great if this tutorial allowed me to sync between the two in the way it works with just OS X.

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Eric,
      your request seems very interesting.
      I use Windows (Widows 7 on a Parallels virtual machine) only for testing website in IE, so I never had the need to sync between Mac and Win.

      Assuming use WAMP, basically we have to:
      1- configure WAMP-apache in similar way as shown in step 2 for MAMP
      2- configure WAMP-MySQL to use data dir in the dropbox folder.

      This could be a good follow-up of this tutorial.

      Ciao
      em

      • http://www.helikopta.com Bill

        How do you get this particular setup to connect through to your Windows virtual machine on Parallels? I can’t seem to get the local vhosts to work.

  • Jeremy Bise

    Thank you for the article. Does anybody have any tips for dealing with links/media within posts/pages? Specifically, whenever you upload an image for instance, on the local environment in a page, it inserts the full hostname (http://local.whatever.com) and then its a pain in the butt to deal with that in production. Or I guess maybe the best practice is not full with actual data entry locally? Just curious as to how others handle this type thing.

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Jeremy,
      in this tutorial i’ve not addressed this issue, but a good starting point could be:
      http://interconnectit.com/124/search-and-replace-for-wordpress-databases/

      Cheers
      em

      • http://www.helikopta.com Bill

        I’ve got the vhosts connected via Parallels virtual machine now, but not sure if this was the right way to do this.

        I edited the “hosts” file on the Windows virtual machine and added my Mac’s IP address to the localhost entry:

        10.0.1.2 localhost

        hosts file is found in:
        c: > Windows > System32 > drivers > etc > hosts

        Mac’s IP address is found:
        System Preferences > Network > Wi-Fi (or whichever one is connected i.e. green) > Under Status you’ll see your Mac’s IP address

        Is this the correct way to do this under your setup in this article?

    • http://www.stefanhinck.com Stefan

      I agree, this is what I am trying to get my head around right now before I try setting this up for use.

      I will be making edits to a sites design elements, independent from its actual content, which is created/edited by the company editors.

      This being the case, should I simply create dummy posts on my local site to serve more as placeholders than anything with the idea that when i push to production the site changes, the production db will populate the pages with data of the same type?

      Does this sound about right?

  • Tommy

    Hi,

    Thanks for a great tutorial. Unfortunately I’ve run into a problem at step 4. When I try to install WordPress, I’m given a 403 Forbidden error. I believe I’ve followed the steps properly, would you know anything off the top of your head?

    Thanks!

    Tommy

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Tommy,
      can you tell me something else about the steps you have followed?

      Ciao
      em

      • http://enricomingardo.com Enrico Mingardo
        Author

        Tommy,
        please check especially that

        /Users/YOURUSERNAME/Dropbox/Development/conf/local-development.conf

        has the

        AllowOverride All

        directive.

        Bye
        em

        • Tommy

          Hi Enrico,

          Thanks for the reply. I checked that and it was turned on. I started again and managed to get it to work somewhat. It no longer gives me 403 Forbidden.

          However, now it’s just displaying the MAMP placeholder page, which is in Applications/MAMP/htdocs. I’m not sure how to get it to properly point to my Dropbox folder.

          In the local-development.conf file, this is everything I have.

          <Directory “/Users/tommy/Dropbox/Development/vhosts/”>
          AllowOverride All
          </Directory>

          #
          # Named Virtual Host
          #
          LogFormat “%V %h %l %u %t \”%r\” %s %b” vcommon
          CustomLog /Users/tommy/Dropbox/Development/logs/access.log vcommon
          ErrorLog /Users/tommy/Dropbox/Development/logs/errors.log
          UseCanonicalName Off
          VirtualDocumentRoot /Users/tommy/Dropbox/Development/vhosts/%0

          Can you spot anything that is wrong?

          • Tommy

            Nevermind, got it to work! :-) Gotta get my head around git now! Thanks!

          • Soufiane

            I’m having the same problem, could you tell us how did you fixed it ?

          • Ankur

            I’m also experiencing the same error, how exactly did you resolve it?

  • Michael

    Is it me or is this approuch a bit to much? Why don’t u simply use XAMPP? Use the standalone/portable version, put it on your Dropbox drive/folder and run it. No changing the Apache or MySQL or anything..

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Micheal,
      I’ve not chosen XAMPP because its home page (http://www.apachefriends.org/en/index.html) states:

      “These Mac OS X and Solaris versions of XAMPP are still in the first steps of development. Use at you own risk!”

      Maybe I’m wrong but MAMP seems to me more reliable at the cost of few configuration changes.

      However if you want use Apache virtual host feature on XAMPP you still need changing Apache configuration and /etc/hosts file.

      Ciao
      em

    • buzztone

      This sounds like a simple option for people using XAMPP on Windows provided XAMPP can be setup to run within the My Dropbox folder.

  • http://www.metaphorcreations.com Joe

    I just quickly browsed through and will go through more in depth later today. Looks like it’s a great tutorial!

    Is it possible to use a Google Drive folder in place of DropBox?

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Joe,
      i usually don’t use Google Drive, but I think that it is possible.
      Ciao
      em

  • http://ebusinessmatters.com Brian Duffy

    great article man. Exactly what I was looking for. What you recommend instead of MAMP for a windows machine? EasyPHP or something else?

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Brian,
      as I wrote in my previous response to Eric, I don’t use Windows as a development platform but I just quickly browsed EasyPHP features and it seems great to me.
      Ciao
      em

    • Joe

      You can use WAMP instead.

      • buzztone

        Mnay people doing local WordPress development in Windows use XAMPP rather than WAMP, but both should work. The folders used in Dropbox would be different from that shown in the tutorial depending the local server used.

  • http://leianivey.com Leian

    Can I manage these sites with Tower?

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Leian,
      I prefer command line git ;-)
      but Tower can be useful.

      Ciao
      em

  • Pingback: ASO Weekly Digest: 6/18 – 6/22 | Web Hosting Blog at ASO

  • Justin

    I’m having a problem with the wordpress setup. I’ve created the database name, I then try to run the wp-admin/install.php file, then nothing. I’m not sure if I have the right URL path to run the install.php?

    Any help would be great.

    • http://enricomingardo.com Enrico Mingardo
      Author

      Hi Justin,
      you can follow the Famous 5-Minute Install.

      Ciao
      e.

    • http://juliangaviria.net Julian Gaviria

      Just a heads up for anyone having trouble setting up the database when using a vhost.

      “MAMP uses custom ports for Apache and MySQL server instances: Apache runs on port 8888, MySQL runs on port 8889. You can maintain this configuration or, as we suggest, change it to use standard ports: 80 for Apache, and 3306 for MySQL.”

      If you maintain the 8888 port for Apache and the 8889 for MySQL the vhost (www.site.dev) will not work properly. It only worked in my setup if I changed it to use the standard ports.

      • shabbs

        @86fe8cdfdc1fe2a4a3c53c1dcf5b8717:disqus When I change these settings in my MAMP, my server and MySQL does not start. they both remain red and dont restart. Any Idea why the standard ports don’t work with my MAMP?

  • Pingback: Tweet-Parade (no.25 June 2012) | gonzoblog.nl

  • http://www.elimcmakin.com Eli McMakin

    Another request for a Windows XAMPP version of this tutorial. That would be AWESOME!

  • http://www.elimcmakin.com Eli McMakin

    Also, why the emphasis on using virtual host? Is that just so you don’t have to change the DB paths once uploaded to the server? Or is there another reason?

  • Tri

    Hi,

    I followed this tut up until the step of creating the local-development.conf step.

    I changed the folder ‘vhost’ to ‘vhosts’ as suggested by the comments.

    I still get the error: “Error: Could not connect to MySQL server!” when trying to open MAMP.

    Any idea?

  • Tri

    Also, is there a specific location where to add these lines to httpd.conf?
    # Includes the configuration shared on Dropbox folder
    Include /Users/tringuyen/Dropbox/Development/conf/local-development.conf

    I notice that when I try to add them at the bottom, the apache server won’t start. However, when I append ‘#’ to the front of ‘Include’ on the second line it works.

  • http://enricomingardo.com Enrico Mingardo
    Author

    Hi Tri,
    append them to the end of /Applications/MAMP/conf/apache/httpd.conf

    Ciao
    e.

    PS: Lines that begin with the hash character “#” are considered comments, and are ignored. ;-)

    • http://toeroek.eu Markus

      when i append the two lines at the end of the file my apache server won’t start – when i put them out everything works fine again

      any ideas what I’m doing wrong?

      • http://www.fluffyjack.com/ Jack Watson-Hamblin

        I’m having the same issue. Nothing appears in the logs though. :P

  • Pingback: Link-Ecke #56 | campino2k

  • http://wpbaseju.mp Piet

    Amazing tutorial, Enrico, thanks so much for the writeup!

    As I only have an iMac, I actually don’t need the syncing part, but all the rest is amazingly useful.

    The only thing I am wondering about is what exactly is the difference between using Git instead of Github? I currently use the latter and that comes with a handy Mac app so there is no need for all the terminal stuff :)

  • Pingback: BlogBuzz June 30, 2012

  • Pingback: Weekend Update – Course Managers @ Tri Nguyen

  • Pingback: Best of Tuts+ in June 2012 | Clixto7

  • Pingback: Best of Tuts+ in June 2012 | DigitalMofo

  • Pingback: Best of Tuts+ in June 2012 | Shadowtek Hosting and Design Solutions

  • begs

    Killer article. Thanks for that one!

  • Soufiane

    Well I finaly tried this and it didn’t work, When I go to http://www.site.dev I have this error :

    The virtual host was set up successfully.

    If you can see this page, your new virtual host was set up successfully. Now, web contents can be added and this placeholder page1 should be replaced or deleted.

    Server name: nihadcar.dev
    Document-Root: /Users/WebDevEur/Dropbox/Development/vhosts

    Tried all the staff above without any luck.
    Apache and MySQL are working fine and old websites still work!!!

    I’m using Lion with MAMP pro

  • Pingback: PSD+ Best of Tuts+ in June 2012 via buypappa.com | Buypappa blog

  • Pingback: NET+ Best of Tuts+ in June 2012 via buypappa.com | Buypappa blog

  • Pingback: VEC+ Best of Tuts+ in June 2012 via buypappa.com | Buypappa blog

  • Antho

    I am trying to follow this using Mamp Pro.

    Somewhere between step 2 and 3, I am having a permissions issue with Mamp Pro in that it won’t let me specify the document root for http://www.site1.dev as being in the dropbox folder we created.

    Has anyone had this issue and what did you do?

  • http://feed2.me David

    Where should I be doing the git commit on changes made directly on the production server? When I do that on the bare repo it says fatal: This operation must be run in a work tree.

  • Tri

    I’m following this tutorial again to install the same system on my new computer (I got it to work on the old one).

    However, after following all the steps exactly, I get a 404 Not Found error when I got to my localhost folder.

    Any idea why this might be the case?

  • Tri

    In the process of getting my setup to work, I figured out a solution.

    Instead of using the local-development config file (And put the include line into the httpd.conf) – which doesn’t work for me, an easy way to make it work for me is go to MAMP window –> Preferences –> Apache –> Select the vhosts folder in Dropbox as the document root.

    I think this method works for MAMP while the other method would work for MAMP Pro? I don’t have MAMP pro and I find this to work fine.

    If anyone else with the same problem let me know.

  • Norman

    Hi,

    Great tutorial, thanks very much!!

    Unfortunately, I ran into some problems at Step 7 that I can’t seem to resolve.

    I followed the steps as given but when I go to the local site site (www.site.dev), I see this

    “define(‘DB_NAME’, ‘site_dev’); define(‘DB_USER’, ‘root’); define(‘DB_PASSWORD’, ‘root’); define(‘DB_HOST’, ‘localhost’);

    Error connecting to the database”

    It seems as if it is executing the include statement and reading the local-config.php file but it is treating it as plain text or comments rather than executing the defines. I can’t figure out what would be causing that.

    It seems like my only option is to ignore the wp-config.php file and create separate versions on each server but that is a less elegant solution.

    Norman

    • http://jplew.com JP

      Yeah, this tripped me up too. I was having your problem, and also the wp-admin “White Screen of Death” for a while there too.

      The solution I found was to wrap the ‘defines’ in my local-config.php with a php tag, like so:

      <?php
      define(‘DB_NAME’, ‘batdog’);
      define(‘DB_USER’, ‘root’);
      define(‘DB_PASSWORD’, ‘root’);
      define(‘DB_HOST’, ‘localhost’);
      ?>

      I don’t claim to understand why, but this did the trick for me.

  • http://lanegoldberg.com Lane

    While I love the idea, I’ve heard that working with git repos in a dropbox folder will inevitably cause problems (especially if you use multiple machines), and I’ve resisted the urge to try.

    sources:
    http://stackoverflow.com/questions/8226256/dropbox-and-git-could-it-cause-conflicts
    http://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively?rq=1

    Then again there are those who say it works fine:
    http://stackoverflow.com/questions/3659707/dropbox-and-git-working-together?rq=1

    Me, a corrupt git repo could be workflow nightmare, so I am going to play it safe for now.

  • dont get it

    Why would you use dropbox when you can use github (or another remote git service) or just host git on your own server, makes no sense.

    This approach is very amateur, jumping through hoops was applicable years ago, but not anymore.

    • http://stefanhinck.com Stefan

      I too would prefer not using Dropbox as it seems kinda workaround-ish, do you know of any other resources explaining how to work in a similar fashion but relying on github or another service like you mention?

      • http://jplew.com JP

        Enrico’s tutorial is extremely helpful, yet I have one constructive criticism in this regard. In the above method he advocates pushing into a repository that has a work tree attached to it. Git actually recommends against this practice: https://git.wiki.kernel.org/index.php/GitFaq#Why_won.27t_I_see_changes_in_the_remote_repo_after_.22git_push.22.3F

        “A quick rule of thumb is to never push into a repository that has a work tree attached to it, until you know what you are doing.”

        I personally found this to be a superior approach: http://joemaller.com/990/a-web-focused-git-workflow/.

        Basically you want to create a bare remote repository that acts as your main hub. This way, you can completely drop out Dropbox and simply create git clones of your remote “Hub” repository on both your laptop and your desktop, like this:

        git clone ssh://user@domain.com/~/site_hub.git

        In this way, once you’ve made some changes on your laptop, just commit them, “git push”, and the remote “Hub” repo will be updated. Then when you switch to your desktop, all you need to do is “git pull” from that side.

    • http://www.facebook.com/sam.selikoff Sam Selikoff

      The difference is he uses Dropbox to keep directories _that belong to the same environment_ in sync with each other. I use this technique as well since I develop on two separate desktops. This is better than setting up a git server because (1) it keeps my commits related to development features rather than arbitrary times of the day when I leave work and come home (necessitating a commit-push-pull), and (2) is _much_ simpler (no commit, no log message, nothing – just come home and work as if I were on the same machine).

      • http://www.facebook.com/nicholas.worth Nicholas Worth

        Also I have done this with a deploy version of XAMPP, much simpler setup and even better integration since the app is not actually installed on either machine. Couple that with the deploy version of SublimeText 2 and lets just say it is something amazing!

  • Steveorevo

    Keep in mind that the MySQL database binaries can contain platform dependent data (Going to/from Windows/Mac/Linux and different versions of MySQL on your host has serious ramifications). Also, the MySQL engine is opening and reading and writing to the database files dynamically.

    Attempting to synch MySQL binaries can result in terrible database corruption. NOT RECOMMENDED.

    This is very reason why you need the scrubbing features in ServerPress.com offerings.

    • http://stefanhinck.com Stefan

      This applies to something I posted above, would it be safe to simply not try and sync the local/prod db but just use dummy data in the local db as placeholders for the page elements?

      So when pushing to prod your actually only pushing front end changes and not touching the db at all?

  • http://www.themeelephant.com/ Markus

    MySQL Server wont start. I have Mountain Lion istalled.
    Is there any solution for this problem?

    Thanks and Regards – Markus

    • http://www.themeelephant.com/ Markus

      Its working now.. I think Mamp was open when i did the changes in terminal.
      Thanks for this great tutorial Enrico!

  • Ryan

    Hoping to get this to work.

    Is the adding the line to the /Applications/MAMP/conf/apache/httpd.conf file supposed to automatically create the /Users/YOURUSERNAME/Dropbox/Development/conf/local-development.conf file? Because I don’t have that file as it stands. Am I supposed to create it?

    • Alexandra

      Hi Ryan,

      Yes, you will have to create the file local-development.conf manually. Putting that line in httpd.conf will only tell the web server to look for the file in that specific location.

  • Alexandra

    Hi Enrico,

    Thanks for this great tutorial. After following steps 1 till 3, I now have MAMP and WordPress working on my Desktop. However, when I go into PHPMyAdmin on my laptop, the WordPress database (that I created on my desktop in step3) does not show up there. This means that WordPress will not start on my laptop.

    Any advise as to what I might be missing? I gave Dropbox a lot of time to sync. All the other files seem to be there.

    Thanks!
    Alexandra

    • Alexandra

      I’ve added the database manually on my laptop. That, unfortunately, leaves me with * two different* instances of WordPress.

      Any suggestions as how to get both systems to sync would be greatly appreciated.

  • Dave

    Enrico,

    Thanks for the very well written tutorial!

    I am just learning to develop WordPress sites, and I have read that many themes and plugins store data in the database. So, if I am working locally on developing my site, adding a new theme or plugin or changing an existing theme or plugin, there is a danger that they will break when deploying to the live site. Data that the new themes or plugins stored on the local database will not be in the live site’s database, thus causing broken links. Furthermore, ‘git push’-ed changes to the live site might break other database links that are on the live site.

    Is there a way around this? Are my thoughts on this correct?

  • http://jplew.com JP Lew

    is there a typo in your post? I don’t understand the difference between ‘repo.git’ and ‘site.git’. On the one hand, you’re creating a repo in site.git like so:

    mkdir site.git
    cd site.git
    git init –bare

    Then in the next step, you’re setting your GIT_DIR to ‘repo.git’:

    export GIT_DIR=~/repo.git

    And finally, at the end, your screenshot says repo.git but your code says site.git.

    • http://www.saltedlolly.com Olly S

      I am having the same problem with my setup. I am trying to install this on my shared server at Dreamhost. I want to have several repositories, one for each website that is hosted in my account.

      My Document Root is at: /home/myusername/website1name.ext

      My repository is at: /home/myusername/website1name.git

      The default folder ( ~ ) is the username folder.

      In my post-receive file I put the following:

      ——————————————————

      #!/bin/bash
      #
      docroot=”/home/myusername/website1name.ext”
      while read oldrev newrev ref
      do
      branch=`echo $ref | cut -d/ -f3`

      if [ "master" == "$branch" ]; then
      git –work-tree=$docroot checkout -f $branch
      fi

      done

      ————————————–

      As far as I can tell this is all correct. The problem I now have is how to configure the bash file when I have multiple websites on the server. I could enter it as follows:

      ————————————–

      # GIT
      export GIT_DIR=~/website1name.git
      export GIT_WORK_TREE=~/website1name.ext

      ————————————–

      The problem is: what do I then enter for website2name.ext ??

  • http://tridnguyen.com Tri Nguyen

    I have a suggestion:

    Instead of changing the MAMP – Apache configuration, you can just simply go to MAMP (the app), click on Preferences. Then go to the “Apache” tab (on the right most), then under “Document Root” just pick the new vhosts folder.

  • http://shovan.co.uk Shovan Sargunam

    Hi My SQL wont start. I have tried all the answers I got from google nothing helps. Any suggestions?

    • http://twitter.com/gwmusic Gordon Wright

      This happened to me too. By following the instructions above, I ended up with a “db” alias inside the MAMP > db folder. That alias needs to replace the original db folder altogether. If that makes any sense…

  • http://www.facebook.com/n.smith5 Nathanael Smith

    I really like the workflow, I think it will work for me. I’m new to git and I’m running into a problem on the server: I have an addon domain that my wordpress site runs on. When I navigate to that directory and run git init --bare I get: fatal: GIT_WORK_TREE (or --work-tree=) not allowed without specifying GIT_DIR (or --git-dir=). What am I doing wrong? How do I fix it?

  • http://www.appsta.com/ Peter

    One of the best tutorial about WordPress i’ve ever read! Thanks

    Have a look at this apps toolbox for WordPress beginners :

    http://www.appsta.com/toolboxes/wordpress-for-the-novice-blogger

    Can help too

  • Pingback: WordPress Development and Deployment With MAMP, Git and Dropbox | Dont Be "That" Dev

  • shabbs

    cannot access http://www.site.dev. Anyone know why this is happening. Please help :(.

  • Whatever

    Really glad I did this tutorial. Now neither of my MAMPs work and I’ve spent more time trying to fix it then I have developing. Good job.

  • henrikcederblad

    @Enrico: I believe there’s a small error in the article; under Step 2 – “Move the Database Folder”, it says:

    “On Desktop move database folder from MAMP standard location to db directory on Dropbox”. And the specified command for that is:


    cd /Applications/MAMP/db

    mv * ~/Dropbox/Development/db/

    This moves the contents of the original db folder inside /Applications/MAMP, not the folder itself (as mentioned). You might want to consider changing it to:


    cd /Applications/MAMP
    mv db ~/Dropbox/Development

    Or, keep the above as is, and change the next following instruction to:

    “On Notebook [and Desktop] open a Terminal and delete the database folder using the following command:


    cd /Applications/MAMP
    rmdir db

    Best regards, Henrik

  • Pingback: 25 WordPress Theme Development Tutorials to Get Started - Daily Design Hub

  • Pingback: 25 WordPress Theme Development Tutorials to Get Started - Rockable Themes

  • Pingback: GIT. Version control | irakasle ibiltaria

  • Pingback: 25 บทความสอนการทำ theme wordpress ตั้งแต่เริ่มต้น!! | Mister sTA

  • Antonio

    This way works for me the httpd.conf:

    UseCanonicalName Off
    LogFormat "%V %h %l %u %t "%r" %s %b" vcommon

    ErrorLog "/Volumes/Macintosh HD/htdocs/logs/errors.log"

    AllowOverride All

    VirtualDocumentRoot "/Volumes/Macintosh HD/htdocs/%0"