MAMP / MAMP Pro IOS Development

Make a site on with MAMP local development.

Development Setup


  • Homebrew ( for terminal ):
  • Xcode ( IOS development requirement, just download you don't have to use it just keep it up to date. )
  • Drush:
  • MAMP / MAMP Pro:

Create a host (local site):

  • Start your server.
  • Click on the "Add Host" button.
  • Select "Empty" if your site is anything other WordPress. If it's WordPress then select "WordPress".
  • In the "Name" field type what you want to call your site.
  • In the "Document Root" field choose the root directory of your site.
  • Click on the "Create Host" button.
  • Now click on the "phpMyAdmin" button.
  • Create a database for the site in phpMyAdmin.
  • Go back to the MAMP interface click on the site that you are creating. Now click on the "Databases" tab and select the new database that goes with this site.
  • Click on the "Save" button.
  • Go back to the "General" tab.
  • Make sure your "PHP version" is set to what you want it to be set to.
  • Make sure your "IP address" is set to your current locations ip address.
  • Click on the "Save" button if you made any updates.
  • Click on the "Open" button and start developing.

Drupal 7 site setup:

  • Duplicate the default.settings.php file and rename it to: settings.local.php
  • Set the database array with your database information.
    $databases = array(
        'driver' => 'mysql',
        'database' => 'database_name',
        'username' => 'database_username',
        'password' => 'database_password',
        'host' => 'localhost',
        'port' => 3306,
        'prefix' => 'myprefix_',
        'collation' => 'utf8_general_ci',
  • Set the base path of the site to your localhost url for it: https://sog.local
  • Lastly go the root directory of this site. Edit the primary .gitignore file and make sure that "settings.local.php" is listed there if it is not then add it to it. ( We do this so we don't push it up to the main codebase and mess up the site/environments. )
  • Now you need to clear the site caches via your terminal using Drush 7. Use the following commands.
    drush @none dl registry_rebuild-7.x
    drush rr

Importing Database via command line into phpMyAdmin:

Open you terminal and type in the following command line example.

Fill in the blank example:

*Quick Tip: You can simply drag the file into the terminal window and it will enter the location of the file for you.

/applications/MAMP/library/bin/mysql -u [USERNAME] -p [DATABASE_NAME] < [PATH_TO_SQL_FILE]

Real example:

/applications/MAMP/library/bin/mysql -u root -p sog_lrs < Downloads/sog-lrs_live_2023-03-16T21-45-05_UTC_database.sql