Drupal 7.31 Installation on XAMPP

Ann K. Hoang
The Cabin Coder
Published in
3 min readSep 26, 2014

This is my quick setup for Drupal 7.31using XAMPP on Mac OS 10.9.5.
I assume XAMMP is already installed for configured on your computer.

1. Go to Drupal.org and install the file. I got the drupal-7.31.tar.gz.

2. Unzip the file and drag the folder into your XAMPP htdocs folder.

  • The path is “Applications/XAMPP/htdocs/” for my Mac. If you are using MAMP or WAMP, there should be a htdocs folder as well.
  • You can rename the original Drupal file to your own project name (instead of drupal-7.xx or which ever version you are using). I renamed mine to drupal_ap2l.

3. Navigate to “/sites/default/” in your drupal project folder.

4. Make another copy of default.settings.php and rename the second copy to settings.php.

  • Drupal needs both files to run.

5. Create a database.

Go to your browser and go to localhost. Navigate to phpMyAdmin page. Click on the database tab and, make a name for the database, and click on “Create” button.

6. Change file permission to enable Drupal installation.

  • Run the ls -l command to see file permission.
  • the d in the beginning means this is a directory, while — (dash) means this is a file
  • rwx stands for read write execute. Currently, only the user has write permission.
  • Change to allow user, group, and world for read, write, execute access by using this command. (If you are concern with such lax security, don’t worry about it right now. We will configure it immediately after the Drupal installation).

ROADBLOCK:

Looks like I need to change permission for all the files in the sites folder.

sudo chmod 777 sites/

7. Go to the browser, and type path name of your drupal project.

  • URL: “localhost/yourdrupalproject/”
  • This should redirect you to the installation page.
  • Input the name of the database you just configure for this project.
  • Database name is root for mine, running on XAMPP. It might be different, depending on your AMP stack.

SUCCESS! The site now runs on your local server.

8. LAST BUT MOST IMPORTANT STEP!

  • You need to disable the write permission again, or there will be serious security issue.
  • Make sure the settings.php and default.settings.php file have 444 permission code. To set this, make sure you are in the default folder, and type this command:

sudo chmod 744 settings.php default.settings.php

Other files in the default folder needs to change permission mode as well. Here is a key for reference. The three number refers to chmod command.

  • default, default/files, default/themes, and default/modules all need 755 (user with full rwx access, while group and world has read and execute permission access):

sudo chmod 755 foldername

  • default/settings.php and default/default.settings.php need to change to 444 (for write only):

sudo chmod 444 filename1 filename2

--

--

Ann K. Hoang
The Cabin Coder

Senior Software Engineer. Born in Saigon. Raised in the Silicon Valley. Currently in Seattle, WA.