Running Drupal 7 on OSX #
This is a two-part series on developing H5P using Drupal:
Step 1. Install a server #
I recommend the free version of MAMP.
Start the server with the GUI to see that it works.
Step 2. Move to the MAMP directory #
$ cd /Applications/MAMP/htdocs
Step 3. Download Drupal 7 #
https://www.drupal.org/docs/7/install/step-1-download-and-extract-drupal
$ curl -O https://ftp.drupal.org/files/projects/drupal-7.56.tar.gz
- Drupal 7 has the h5p development folder and 7.56 is the latest version of Drupal
Step 4. Extract Drupal 7 #
Type the following command and replace “7.x” with your downloaded version’s number:
tar -xvzf drupal-7.56.tar.gz
Then remove the compressed version of the file by using the following command:
rm drupal-7.56.tar.gz
Rename the folder
$ mv drupal-7.56 drupal
Your MAMP directory should look like:
$ ls
$ drupal index.php
Step 5. Create the db #
To create a database for Drupal
- Go to the MAMP start page.
- Under “Tools”, click the link to “phpMyAdmin”.
- On the phpMyAdmin page, click the “Databases” tab.
- Under the “Create database” section, enter a name for your Drupal database in the “Database name” field.
- Select “utf8_general_ci” from the “Collation” drop-down (must be utf8!).
- Click “Create”.
- Look on the left-hand column under the phpMyAdmin logo and make sure that your new database is selected. If it’s not, go ahead and click on it.
- Select the “Privileges” tab.
- Under the “New” section, click on “Add user account”.
- Fill out these fields in the “Login Information” form:
- “User name” → choose a username
- “Host name” → field to “Local”. Leaving it as “Any host” will not allow Drupal to connect to your local database and you’ll get an error.
- “Password” → choose a password
- Leave the default settings for the remaining sections.
- Click the “Go” button. This creates the user and takes you to the “Edit Privileges” for this new user on the new database.
- Under the “Database-specific privileges” section, make sure the following check boxes are selected: SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP.
- Click the “Go” button.
- Click the small home icon under the phpMyAdmin logo in the left-hand column.
- Click into the “User accounts” tab.
- Next to your new User name, click the “Edit privileges” link. This will take you to the Global settings for this user.
- Under the “Data” section, make sure SELECT, INSERT, UPDATE, and DELETE are selected.
- Under the “Structure” section, make sure CREATE, INDEX, and DROP are selected.
- Click the “Go” button.
The instructions for downloading and installing drupal are here:
https://www.drupal.org/docs/7/install/step-1-download-and-extract-drupal
Here are the relevant bits: https://www.drupal.org/docs/develop/local-server-setup/mac-os-development-environment/howto-create-a-local-environment-using-mamp
https://drive.google.com/file/d/1kyLZ7KUhl9kjF6vkd6C2DiuETfC0YbGV/view?usp=sharing