Si funciona perfectamente, este codigo
<?php
chdir("../");
echo getcwd();
echo "<br>";
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
//global $user;
print_r($user);
?>
me obtiene
/var/www/vhosts/MyDominio.es/httpdocs
stdClass Object ( [uid] => 0 [hostname] =>xxx.xxx.xxx.xxx [roles] => Array ( [1] => anonymous user ) [session] => [cache] => 0 )
Mientras, el mismo codigo sin la linea del chdir lo ejecuto en la raiz me da
/var/www/vhosts/MyDominio.es/httpdocs
stdClass Object ( [uid] => 281 [name] => ags [pass] => 28d5c02fa836eaede52cc9b60bec9f07 [mail] =>
[email protected] [mode] => 0 [sort] => 0 [threshold] => 0 [theme] => [signature] => [created] => 1343716900 [access] => 1343813148 [login] => 1343808908 [status] => 1 [timezone] => 3600 [language] => es [picture] => [init] => [data] => a:1:{s:18:"admin_compact_mode";b:1;} [sid] => m7621slb9jrnfoaqkheaerct84 [hostname] => 212.79.145.133 [timestamp] => 1343813148 [cache] => 0 [session] => [admin_compact_mode] => 1 [roles] => Array ( [2] => authenticated user [3] => editor [7] => admin ) )
el chdir, funciona bien! creo yo
saludos