I wrote PHP script which has to bootstrap ex1.mydrupalsite.pl
The sites are hosted using Aegir platform.
The structure looks like this:
/var/aegir/platforms/drupal-7.31/sites/ex1.mydrupalsite.pl
/var/aegir/platforms/drupal-7.31/sites/ex2.mydrupalsite.pl
# etc...
I've been trying:
define('DRUPAL_ROOT', '/var/aegir/platforms/drupal-7.31');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
$_SERVER['HTTP_HOST'] = 'ex1.mydrupalsite.pl';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['SCRIPT_NAME'] = '/' . basename(__FILE__);
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
But no luck.
The problem is that in an Aegir installation, the database access information is -not- stored in settings.php, but in /var/aegir/config/server_master/apache/vhost.d/[sitename] as $_SERVER environment variables. You need to specifically declare them in your script.
Or better yet, use "Drush scr" to run the script. It'll do the bootstrapping work for you! See http://www.oliverdavies.uk/blog/dont-bootstrap-drupal-use-drush/ for a more detailed explanation.