C:/drupal/sites/default/default.settings.php File Reference

Go to the source code of this file.


Variables

 $db_url = 'mysql://username:password@localhost/databasename'
 $db_prefix = ''
 $update_free_access = FALSE


Detailed Description

Drupal site-specific configuration file.

IMPORTANT NOTE: This file may have been set to read-only by the Drupal installation program. If you make changes to this file, be sure to protect it again after making your modifications. Failure to remove write permissions to this file is a security risk.

The configuration file to be loaded is based upon the rules below.

The configuration directory will be discovered by stripping the website's hostname from left to right and pathname from right to left. The first configuration file found will be used and any others will be ignored. If no other configuration file is found then the default configuration file at 'sites/default' will be used.

For example, for a fictitious site installed at the 'settings.php' is searched in the following directories:

1. sites/www.drupal.org.mysite.test 2. sites/drupal.org.mysite.test 3. sites/org.mysite.test

4. sites/www.drupal.org.mysite 5. sites/drupal.org.mysite 6. sites/org.mysite

7. sites/www.drupal.org 8. sites/drupal.org 9. sites/org

10. sites/default

If you are installing on a non-standard port number, prefix the hostname with that number. For example, could be loaded from sites/8080.www.drupal.org.mysite.test/.

Definition in file default.settings.php.


Variable Documentation

$db_prefix = ''

$db_url = 'mysql://username:password@localhost/databasename'

Database settings:

Note that the $db_url variable gets parsed using PHP's built-in URL parser (i.e. using the "parse_url()" function) so make sure not to confuse the parser. If your username, password or database name contain characters used to delineate $db_url parts, you can escape them via URI hex encodings:

: = 3a / = 2f @ = 40 + = 2b ( = 28 ) = 29 ? = 3f = = 3d & = 26

To specify multiple connections to be used in your site (i.e. for complex custom modules) you can also specify an associative array of $db_url variables with the 'default' element used until otherwise requested.

You can optionally set prefixes for some or all database table names by using the $db_prefix setting. If a prefix is specified, the table name will be prepended with its value. Be sure to use valid database characters only, usually alphanumeric and underscore. If no prefixes are desired, leave it as an empty string ''.

To have all database names prefixed, set $db_prefix as a string:

$db_prefix = 'main_';

To provide prefixes for specific tables, set $db_prefix as an array. The array's keys are the table names and the values are the prefixes. The 'default' element holds the prefix for any tables not specified elsewhere in the array. Example:

$db_prefix = array( 'default' => 'main_', 'users' => 'shared_', 'sessions' => 'shared_', 'role' => 'shared_', 'authmap' => 'shared_', 'sequences' => 'shared_', );

Database URL format: $db_url = 'mysql://username:password/databasename'; $db_url = 'mysqli://username:password/databasename'; $db_url = 'pgsql://username:password/databasename';

Definition at line 93 of file default.settings.php.

Referenced by _install_settings_form_validate(), conf_init(), db_set_active(), install_change_settings(), install_settings_form_validate(), and install_verify_settings().

$update_free_access = FALSE

Access control for update.php script

If you are updating your Drupal installation using the update.php script being not logged in as administrator, you will need to modify the access check statement below. Change the FALSE to a TRUE to disable the access check. After finishing the upgrade, be sure to open this file again and change the TRUE back to a FALSE!

Definition at line 105 of file default.settings.php.

Referenced by conf_init().


Generated on Mon Jun 2 15:08:35 2008 for SimpleTest by  1.5.5