1. 4.6 sites/default/settings.php
  2. 4.7 sites/default/settings.php
  3. 5 sites/default/settings.php
  4. 8 core/lib/Drupal/Core/Site/Settings.php

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 http://www.drupal.org/mysite/test/, 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, http://www.drupal.org:8080/mysite/test/ could be loaded from sites/8080.www.drupal.org.mysite.test/.

File

sites/default/settings.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Drupal site-specific configuration file.
  5. *
  6. * IMPORTANT NOTE:
  7. * This file may have been set to read-only by the Drupal installation
  8. * program. If you make changes to this file, be sure to protect it again
  9. * after making your modifications. Failure to remove write permissions
  10. * to this file is a security risk.
  11. *
  12. * The configuration file to be loaded is based upon the rules below.
  13. *
  14. * The configuration directory will be discovered by stripping the
  15. * website's hostname from left to right and pathname from right to
  16. * left. The first configuration file found will be used and any
  17. * others will be ignored. If no other configuration file is found
  18. * then the default configuration file at 'sites/default' will be used.
  19. *
  20. * For example, for a fictitious site installed at
  21. * http://www.drupal.org/mysite/test/, the 'settings.php'
  22. * is searched in the following directories:
  23. *
  24. * 1. sites/www.drupal.org.mysite.test
  25. * 2. sites/drupal.org.mysite.test
  26. * 3. sites/org.mysite.test
  27. *
  28. * 4. sites/www.drupal.org.mysite
  29. * 5. sites/drupal.org.mysite
  30. * 6. sites/org.mysite
  31. *
  32. * 7. sites/www.drupal.org
  33. * 8. sites/drupal.org
  34. * 9. sites/org
  35. *
  36. * 10. sites/default
  37. *
  38. * If you are installing on a non-standard port number, prefix the
  39. * hostname with that number. For example,
  40. * http://www.drupal.org:8080/mysite/test/ could be loaded from
  41. * sites/8080.www.drupal.org.mysite.test/.
  42. */
  43. /**
  44. * Database settings:
  45. *
  46. * Note that the $db_url variable gets parsed using PHP's built-in
  47. * URL parser (i.e. using the "parse_url()" function) so make sure
  48. * not to confuse the parser. If your username, password
  49. * or database name contain characters used to delineate
  50. * $db_url parts, you can escape them via URI hex encodings:
  51. *
  52. * : = %3a / = %2f @ = %40
  53. * + = %2b ( = %28 ) = %29
  54. * ? = %3f = = %3d & = %26
  55. *
  56. * To specify multiple connections to be used in your site (i.e. for
  57. * complex custom modules) you can also specify an associative array
  58. * of $db_url variables with the 'default' element used until otherwise
  59. * requested.
  60. *
  61. * You can optionally set prefixes for some or all database table names
  62. * by using the $db_prefix setting. If a prefix is specified, the table
  63. * name will be prepended with its value. Be sure to use valid database
  64. * characters only, usually alphanumeric and underscore. If no prefixes
  65. * are desired, leave it as an empty string ''.
  66. *
  67. * To have all database names prefixed, set $db_prefix as a string:
  68. *
  69. * $db_prefix = 'main_';
  70. *
  71. * To provide prefixes for specific tables, set $db_prefix as an array.
  72. * The array's keys are the table names and the values are the prefixes.
  73. * The 'default' element holds the prefix for any tables not specified
  74. * elsewhere in the array. Example:
  75. *
  76. * $db_prefix = array(
  77. * 'default' => 'main_',
  78. * 'users' => 'shared_',
  79. * 'sessions' => 'shared_',
  80. * 'role' => 'shared_',
  81. * 'authmap' => 'shared_',
  82. * 'sequences' => 'shared_',
  83. * );
  84. *
  85. * Database URL format:
  86. * $db_url = 'mysql://username:password@localhost/databasename';
  87. * $db_url = 'mysqli://username:password@localhost/databasename';
  88. * $db_url = 'pgsql://username:password@localhost/databasename';
  89. */
  90. $db_url = 'mysql://username:password@localhost/databasename';
  91. $db_prefix = '';
  92. /**
  93. * Base URL (optional).
  94. *
  95. * If you are experiencing issues with different site domains,
  96. * uncomment the Base URL statement below (remove the leading hash sign)
  97. * and fill in the URL to your Drupal installation.
  98. *
  99. * You might also want to force users to use a given domain.
  100. * See the .htaccess file for more information.
  101. *
  102. * Examples:
  103. * $base_url = 'http://www.example.com';
  104. * $base_url = 'http://www.example.com:8888';
  105. * $base_url = 'http://www.example.com/drupal';
  106. * $base_url = 'https://www.example.com:8888/drupal';
  107. *
  108. * It is not allowed to have a trailing slash; Drupal will add it
  109. * for you.
  110. */
  111. # $base_url = 'http://www.example.com'; // NO trailing slash!
  112. /**
  113. * PHP settings:
  114. *
  115. * To see what PHP settings are possible, including whether they can
  116. * be set at runtime (ie., when ini_set() occurs), read the PHP
  117. * documentation at http://www.php.net/manual/en/ini.php#ini.list
  118. * and take a look at the .htaccess file to see which non-runtime
  119. * settings are used there. Settings defined here should not be
  120. * duplicated there so as to avoid conflict issues.
  121. */
  122. ini_set('arg_separator.output', '&amp;');
  123. ini_set('magic_quotes_runtime', 0);
  124. ini_set('magic_quotes_sybase', 0);
  125. ini_set('session.cache_expire', 200000);
  126. ini_set('session.cache_limiter', 'none');
  127. ini_set('session.cookie_lifetime', 2000000);
  128. ini_set('session.gc_maxlifetime', 200000);
  129. ini_set('session.save_handler', 'user');
  130. ini_set('session.use_cookies', 1);
  131. ini_set('session.use_only_cookies', 1);
  132. ini_set('session.use_trans_sid', 0);
  133. ini_set('url_rewriter.tags', '');
  134. /**
  135. * Drupal automatically generates a unique session cookie name for each site
  136. * based on on its full domain name. If you have multiple domains pointing at
  137. * the same Drupal site, you can either redirect them all to a single domain
  138. * (see comment in .htaccess), or uncomment the line below and specify their
  139. * shared base domain. Doing so assures that users remain logged in as they
  140. * cross between your various domains.
  141. */
  142. # $cookie_domain = 'example.com';
  143. /**
  144. * Variable overrides:
  145. *
  146. * To override specific entries in the 'variable' table for this site,
  147. * set them here. You usually don't need to use this feature. This is
  148. * useful in a configuration file for a vhost or directory, rather than
  149. * the default settings.php. Any configuration setting from the 'variable'
  150. * table can be given a new value.
  151. *
  152. * Remove the leading hash signs to enable.
  153. */
  154. # $conf = array(
  155. # 'site_name' => 'My Drupal site',
  156. # 'theme_default' => 'minnelli',
  157. # 'anonymous' => 'Visitor',
  158. # );