Drafts‎ > ‎

Draft - Installing Drupal

posted Apr 14, 2009, 9:35 PM by Brian Hagerty

Installing locally under XAMPP

Thinking out loud about how Drupal must work, as a means of figuring out opaque multiple-sites feature

Installing specifically to do exercises in Using Drupal book


  • Install Drupal in \htdocs directory, which is where XAMPP puts web-accessible files
    • To keep this separate from other Drupal installations, I installed all the book's source files in a \usingdrupal subdirectory pf \htdocs
    • So the path to Drupal's main installation script is http://localhost/usingdrupal/drupal/install.php
    • And navigating to http://localhost/usingdrupal/drupal/ pulls up Drupal's installer, which asks you to select an "Installation Profile"
      • I picked Wiki
      • Freakishly, I get a timeout: Fatal error: Maximum execution time of 60 seconds exceeded in F:\xampp\htdocs\usingdrupal\drupal\includes\file.inc on line 886
        • Why am I having this problem on an dual-core Athlon machine?
        • I tried to solve this through the method mentioned here: increasing php_value max_execution_time in .htaccess to 600
        • This worked (in an earlier installation, it did not), but not I get an error because I forgot to copy default.settings.php to settings.php in \htdocs\usingdrupal\drupal\sites\default
          • This doesn't bode well for using multi-site installation, since the profile is trying to modify the default settings.php and not one of the settings.php files in one of the subdirectories.
          • And this was my confirmation message: "All necessary changes to ./sites/default and ./sites/default/settings.php have been made. They have been set to read-only for security."
  • Using phpMyAdmin (at http://localhost/phpmyadmin/), create a user that Drupal will run as. This user is basically "Drupal itself," not an actual user.
    • Go to "Privileges" tab and click "Add a new user." (I am creating the user before the databases and granting the user global privileges on all databases. I'm not sure this is a great idea for a production environment.)
      • Pick any name (I picked "usingdrupal")
      • Set "Host" dropdown to "Local" (this will fill in "localhost" in the adjacent textbox)
      • Enter a password (I picked "oreilly" to be consistent with the book)
      • Leave the radio button for "Database for user" set to "None"
      • Under "Global Privileges," check the following:
        • These are the privileges needed according to INSTALL.mysql.txt in the Drupal 6 installation files (see
        • Note: Drupal 5 required two additional privileges, CREATE TEMPORARY TABLES and LOCK TABLES (see here). I believe that these are no longer needed in Drupal 6. But I asked a question about this on john & cailin's blog. (Note: my comment was not up right away; they must moderate them.)
          • See Drup.org (archived here) (also has interesting scripts for setting up Drupal w/temporary tables.
    • (Note: Typical Drupal-installation instructions tell you to (1) create the database, (2) create a user (Drupal itself), and (3) grant that user privileges on the database.)
  • At the phpMyAdmin home page, create eight MySql databases (one each chapters 3–10 in Using Drupal)
    • jobs, reviews, wiki, newspaper, gallery, i18n, events, store
    • For each database:
      • In phpMyAdmin, create new database: (1) enter its name, and (2) change "collation" dropdown to utf8_unicode_ci (the Drupal documentation buries this requirement).
      • (Note: It's unclear to me whether you should change the "MySQL connection collation" setting, which (by default) is utf8_general_ci. I think not. It's also unclear to me whether this is necessary, since the utf8_general_ci may be insignificantly different from utf8_unicode_ci)
    • If you didn't create a user and assign global privileges as discussed above, you'll need to create a user and assign it either (1) global rights, or (2) rights to each particular database.
    • To assign the user rights to each database
      • If you haven't yet, create a user that Drupal will run as (a "Drupal-itself" user)
      • In "Privileges" tab of phpMyAdmin (at http://localhost/phpmyadmin/), click on the username for the Drupal-itself user
      • In the "Database-specific privileges" box, select one of the databases in the dropdown list that says "Use text field"; the page will change and allow you to grant particular privileges on the chosen database alone.
  • Create subdirectories under Drupal's \sites directory to hold, at least, separate settings.php files for each database
    • This will be a "multisite" Drupal installation. I hope.
    • So the directories are: \htdocs\usingdrupal\drupal\
      • jobs.usingdrupal.local
      • reviews.usingdrupal.local
      • etc