Skip to content

Instantly share code, notes, and snippets.

@delphian
Created September 5, 2013 23:47
Show Gist options
  • Save delphian/6457774 to your computer and use it in GitHub Desktop.
Save delphian/6457774 to your computer and use it in GitHub Desktop.
Bootstrap Drupal multi-site for custom php script
<?php
// Needed for multisite bootstrap.
$_SERVER['HTTP_HOST'] = 'domainname.org';
// Name of this script. Include forward slash.
$_SERVER['SCRIPT_NAME'] = '/' . 'bootstrap-drupal.php';
// Set this to avoid php warnings.
$_SERVER['REMOTE_ADDR'] = '';
define('DRUPAL_ROOT', '/Absolute/path/domainname.org');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
// Bootstrap drupal.
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment