default.settings.php

  1. drupal
    1. 6 sites/default/default.settings.php
    2. 7 sites/default/default.settings.php
    3. 8 sites/default/default.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:

  • sites/www.drupal.org.mysite.test
  • sites/drupal.org.mysite.test
  • sites/org.mysite.test
  • sites/www.drupal.org.mysite
  • sites/drupal.org.mysite
  • sites/org.mysite
  • sites/www.drupal.org
  • sites/drupal.org
  • sites/org
  • 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/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. * - sites/www.drupal.org.mysite.test
  25. * - sites/drupal.org.mysite.test
  26. * - sites/org.mysite.test
  27. *
  28. * - sites/www.drupal.org.mysite
  29. * - sites/drupal.org.mysite
  30. * - sites/org.mysite
  31. *
  32. * - sites/www.drupal.org
  33. * - sites/drupal.org
  34. * - sites/org
  35. *
  36. * - 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. * The $databases array specifies the database connection or
  47. * connections that Drupal may use. Drupal is able to connect
  48. * to multiple databases, including multiple types of databases,
  49. * during the same request.
  50. *
  51. * Each database connection is specified as an array of settings,
  52. * similar to the following:
  53. * @code
  54. * array(
  55. * 'driver' => 'mysql',
  56. * 'database' => 'databasename',
  57. * 'username' => 'username',
  58. * 'password' => 'password',
  59. * 'host' => 'localhost',
  60. * 'port' => 3306,
  61. * 'prefix' => 'myprefix_',
  62. * 'collation' => 'utf8_general_ci',
  63. * );
  64. * @endcode
  65. *
  66. * The "driver" property indicates what Drupal database driver the
  67. * connection should use. This is usually the same as the name of the
  68. * database type, such as mysql or sqlite, but not always. The other
  69. * properties will vary depending on the driver. For SQLite, you must
  70. * specify a database file name in a directory that is writable by the
  71. * webserver. For most other drivers, you must specify a
  72. * username, password, host, and database name.
  73. *
  74. * Transaction support is enabled by default for all drivers that support it,
  75. * including MySQL. To explicitly disable it, set the 'transactions' key to
  76. * FALSE.
  77. * Note that some configurations of MySQL, such as the MyISAM engine, don't
  78. * support it and will proceed silently even if enabled. If you experience
  79. * transaction related crashes with such configuration, set the 'transactions'
  80. * key to FALSE.
  81. *
  82. * For each database, you may optionally specify multiple "target" databases.
  83. * A target database allows Drupal to try to send certain queries to a
  84. * different database if it can but fall back to the default connection if not.
  85. * That is useful for master/slave replication, as Drupal may try to connect
  86. * to a slave server when appropriate and if one is not available will simply
  87. * fall back to the single master server.
  88. *
  89. * The general format for the $databases array is as follows:
  90. * @code
  91. * $databases['default']['default'] = $info_array;
  92. * $databases['default']['slave'][] = $info_array;
  93. * $databases['default']['slave'][] = $info_array;
  94. * $databases['extra']['default'] = $info_array;
  95. * @endcode
  96. *
  97. * In the above example, $info_array is an array of settings described above.
  98. * The first line sets a "default" database that has one master database
  99. * (the second level default). The second and third lines create an array
  100. * of potential slave databases. Drupal will select one at random for a given
  101. * request as needed. The fourth line creates a new database with a name of
  102. * "extra".
  103. *
  104. * For a single database configuration, the following is sufficient:
  105. * @code
  106. * $databases['default']['default'] = array(
  107. * 'driver' => 'mysql',
  108. * 'database' => 'databasename',
  109. * 'username' => 'username',
  110. * 'password' => 'password',
  111. * 'host' => 'localhost',
  112. * 'prefix' => 'main_',
  113. * 'collation' => 'utf8_general_ci',
  114. * );
  115. * @endcode
  116. *
  117. * You can optionally set prefixes for some or all database table names
  118. * by using the 'prefix' setting. If a prefix is specified, the table
  119. * name will be prepended with its value. Be sure to use valid database
  120. * characters only, usually alphanumeric and underscore. If no prefixes
  121. * are desired, leave it as an empty string ''.
  122. *
  123. * To have all database names prefixed, set 'prefix' as a string:
  124. * @code
  125. * 'prefix' => 'main_',
  126. * @endcode
  127. * To provide prefixes for specific tables, set 'prefix' as an array.
  128. * The array's keys are the table names and the values are the prefixes.
  129. * The 'default' element is mandatory and holds the prefix for any tables
  130. * not specified elsewhere in the array. Example:
  131. * @code
  132. * 'prefix' => array(
  133. * 'default' => 'main_',
  134. * 'users' => 'shared_',
  135. * 'sessions' => 'shared_',
  136. * 'role' => 'shared_',
  137. * 'authmap' => 'shared_',
  138. * ),
  139. * @endcode
  140. * You can also use a reference to a schema/database as a prefix. This maybe
  141. * useful if your Drupal installation exists in a schema that is not the default
  142. * or you want to access several databases from the same code base at the same
  143. * time.
  144. * Example:
  145. * @code
  146. * 'prefix' => array(
  147. * 'default' => 'main.',
  148. * 'users' => 'shared.',
  149. * 'sessions' => 'shared.',
  150. * 'role' => 'shared.',
  151. * 'authmap' => 'shared.',
  152. * );
  153. * @endcode
  154. * NOTE: MySQL and SQLite's definition of a schema is a database.
  155. *
  156. * Advanced users can add or override initial commands to execute when
  157. * connecting to the database server, as well as PDO connection settings. For
  158. * example, to enable MySQL SELECT queries to exceed the max_join_size system
  159. * variable, and to reduce the database connection timeout to 5 seconds:
  160. *
  161. * @code
  162. * $databases['default']['default'] = array(
  163. * 'init_commands' => array(
  164. * 'big_selects' => 'SET SQL_BIG_SELECTS=1',
  165. * ),
  166. * 'pdo' => array(
  167. * PDO::ATTR_TIMEOUT => 5,
  168. * ),
  169. * );
  170. * @endcode
  171. *
  172. * WARNING: These defaults are designed for database portability. Changing them
  173. * may cause unexpected behavior, including potential data loss.
  174. *
  175. * @see DatabaseConnection_mysql::__construct
  176. * @see DatabaseConnection_pgsql::__construct
  177. * @see DatabaseConnection_sqlite::__construct
  178. *
  179. * Database configuration format:
  180. * @code
  181. * $databases['default']['default'] = array(
  182. * 'driver' => 'mysql',
  183. * 'database' => 'databasename',
  184. * 'username' => 'username',
  185. * 'password' => 'password',
  186. * 'host' => 'localhost',
  187. * 'prefix' => '',
  188. * );
  189. * $databases['default']['default'] = array(
  190. * 'driver' => 'pgsql',
  191. * 'database' => 'databasename',
  192. * 'username' => 'username',
  193. * 'password' => 'password',
  194. * 'host' => 'localhost',
  195. * 'prefix' => '',
  196. * );
  197. * $databases['default']['default'] = array(
  198. * 'driver' => 'sqlite',
  199. * 'database' => '/path/to/databasefilename',
  200. * );
  201. * @endcode
  202. */
  203. $databases = array();
  204. /**
  205. * Access control for update.php script.
  206. *
  207. * If you are updating your Drupal installation using the update.php script but
  208. * are not logged in using either an account with the "Administer software
  209. * updates" permission or the site maintenance account (the account that was
  210. * created during installation), you will need to modify the access check
  211. * statement below. Change the FALSE to a TRUE to disable the access check.
  212. * After finishing the upgrade, be sure to open this file again and change the
  213. * TRUE back to a FALSE!
  214. */
  215. $update_free_access = FALSE;
  216. /**
  217. * Salt for one-time login links and cancel links, form tokens, etc.
  218. *
  219. * This variable will be set to a random value by the installer. All one-time
  220. * login links will be invalidated if the value is changed. Note that if your
  221. * site is deployed on a cluster of web servers, you must ensure that this
  222. * variable has the same value on each server. If this variable is empty, a hash
  223. * of the serialized database credentials will be used as a fallback salt.
  224. *
  225. * For enhanced security, you may set this variable to a value using the
  226. * contents of a file outside your docroot that is never saved together
  227. * with any backups of your Drupal files and database.
  228. *
  229. * Example:
  230. * $drupal_hash_salt = file_get_contents('/home/example/salt.txt');
  231. *
  232. */
  233. $drupal_hash_salt = '';
  234. /**
  235. * Location of the site configuration files.
  236. *
  237. * By default, Drupal configuration files are stored in a randomly named
  238. * directory under the default public files path. On install the
  239. * named directory is created in the default files directory. For enhanced
  240. * security, you may set this variable to a location outside your docroot.
  241. *
  242. * @todo Flesh this out, provide more details, etc.
  243. *
  244. * Example:
  245. * $config_directory_name = '/some/directory/outside/webroot';
  246. */
  247. $config_directory_name = '';
  248. /**
  249. * Base URL (optional).
  250. *
  251. * If Drupal is generating incorrect URLs on your site, which could
  252. * be in HTML headers (links to CSS and JS files) or visible links on pages
  253. * (such as in menus), uncomment the Base URL statement below (remove the
  254. * leading hash sign) and fill in the absolute URL to your Drupal installation.
  255. *
  256. * You might also want to force users to use a given domain.
  257. * See the .htaccess file for more information.
  258. *
  259. * Examples:
  260. * $base_url = 'http://www.example.com';
  261. * $base_url = 'http://www.example.com:8888';
  262. * $base_url = 'http://www.example.com/drupal';
  263. * $base_url = 'https://www.example.com:8888/drupal';
  264. *
  265. * It is not allowed to have a trailing slash; Drupal will add it
  266. * for you.
  267. */
  268. # $base_url = 'http://www.example.com'; // NO trailing slash!
  269. /**
  270. * PHP settings:
  271. *
  272. * To see what PHP settings are possible, including whether they can be set at
  273. * runtime (by using ini_set()), read the PHP documentation:
  274. * http://php.net/manual/ini.list.php
  275. * See drupal_initialize_variables() in includes/bootstrap.inc for required
  276. * runtime settings and the .htaccess file for non-runtime settings. Settings
  277. * defined there should not be duplicated here so as to avoid conflict issues.
  278. */
  279. /**
  280. * Some distributions of Linux (most notably Debian) ship their PHP
  281. * installations with garbage collection (gc) disabled. Since Drupal depends on
  282. * PHP's garbage collection for clearing sessions, ensure that garbage
  283. * collection occurs by using the most common settings.
  284. */
  285. ini_set('session.gc_probability', 1);
  286. ini_set('session.gc_divisor', 100);
  287. /**
  288. * Set session lifetime (in seconds), i.e. the time from the user's last visit
  289. * to the active session may be deleted by the session garbage collector. When
  290. * a session is deleted, authenticated users are logged out, and the contents
  291. * of the user's $_SESSION variable is discarded.
  292. */
  293. ini_set('session.gc_maxlifetime', 200000);
  294. /**
  295. * Set session cookie lifetime (in seconds), i.e. the time from the session is
  296. * created to the cookie expires, i.e. when the browser is expected to discard
  297. * the cookie. The value 0 means "until the browser is closed".
  298. */
  299. ini_set('session.cookie_lifetime', 2000000);
  300. /**
  301. * If you encounter a situation where users post a large amount of text, and
  302. * the result is stripped out upon viewing but can still be edited, Drupal's
  303. * output filter may not have sufficient memory to process it. If you
  304. * experience this issue, you may wish to uncomment the following two lines
  305. * and increase the limits of these variables. For more information, see
  306. * http://php.net/manual/pcre.configuration.php.
  307. */
  308. # ini_set('pcre.backtrack_limit', 200000);
  309. # ini_set('pcre.recursion_limit', 200000);
  310. /**
  311. * Drupal automatically generates a unique session cookie name for each site
  312. * based on its full domain name. If you have multiple domains pointing at the
  313. * same Drupal site, you can either redirect them all to a single domain (see
  314. * comment in .htaccess), or uncomment the line below and specify their shared
  315. * base domain. Doing so assures that users remain logged in as they cross
  316. * between your various domains. Make sure to always start the $cookie_domain
  317. * with a leading dot, as per RFC 2109.
  318. */
  319. # $cookie_domain = '.example.com';
  320. /**
  321. * Variable overrides:
  322. *
  323. * To override specific entries in the 'variable' table for this site,
  324. * set them here. You usually don't need to use this feature. This is
  325. * useful in a configuration file for a vhost or directory, rather than
  326. * the default settings.php. Any configuration setting from the 'variable'
  327. * table can be given a new value. Note that any values you provide in
  328. * these variable overrides will not be modifiable from the Drupal
  329. * administration interface.
  330. *
  331. * The following overrides are examples:
  332. * - site_name: Defines the site's name.
  333. * - theme_default: Defines the default theme for this site.
  334. * - anonymous: Defines the human-readable name of anonymous users.
  335. * Remove the leading hash signs to enable.
  336. */
  337. # $conf['site_name'] = 'My Drupal site';
  338. # $conf['theme_default'] = 'stark';
  339. # $conf['anonymous'] = 'Visitor';
  340. /**
  341. * A custom theme can be set for the offline page. This applies when the site
  342. * is explicitly set to maintenance mode through the administration page or when
  343. * the database is inactive due to an error. It can be set through the
  344. * 'maintenance_theme' key. The template file should also be copied into the
  345. * theme. It is located inside 'core/modules/system/maintenance-page.tpl.php'.
  346. * Note: This setting does not apply to installation and update pages.
  347. */
  348. # $conf['maintenance_theme'] = 'bartik';
  349. /**
  350. * Reverse Proxy Configuration:
  351. *
  352. * Reverse proxy servers are often used to enhance the performance
  353. * of heavily visited sites and may also provide other site caching,
  354. * security, or encryption benefits. In an environment where Drupal
  355. * is behind a reverse proxy, the real IP address of the client should
  356. * be determined such that the correct client IP address is available
  357. * to Drupal's logging, statistics, and access management systems. In
  358. * the most simple scenario, the proxy server will add an
  359. * X-Forwarded-For header to the request that contains the client IP
  360. * address. However, HTTP headers are vulnerable to spoofing, where a
  361. * malicious client could bypass restrictions by setting the
  362. * X-Forwarded-For header directly. Therefore, Drupal's proxy
  363. * configuration requires the IP addresses of all remote proxies to be
  364. * specified in $conf['reverse_proxy_addresses'] to work correctly.
  365. *
  366. * Enable this setting to get Drupal to determine the client IP from
  367. * the X-Forwarded-For header (or $conf['reverse_proxy_header'] if set).
  368. * If you are unsure about this setting, do not have a reverse proxy,
  369. * or Drupal operates in a shared hosting environment, this setting
  370. * should remain commented out.
  371. *
  372. * In order for this setting to be used you must specify every possible
  373. * reverse proxy IP address in $conf['reverse_proxy_addresses'].
  374. * If a complete list of reverse proxies is not available in your
  375. * environment (for example, if you use a CDN) you may set the
  376. * $_SERVER['REMOTE_ADDR'] variable directly in settings.php.
  377. * Be aware, however, that it is likely that this would allow IP
  378. * address spoofing unless more advanced precautions are taken.
  379. */
  380. # $conf['reverse_proxy'] = TRUE;
  381. /**
  382. * Specify every reverse proxy IP address in your environment.
  383. * This setting is required if $conf['reverse_proxy'] is TRUE.
  384. */
  385. # $conf['reverse_proxy_addresses'] = array('a.b.c.d', ...);
  386. /**
  387. * Set this value if your proxy server sends the client IP in a header
  388. * other than X-Forwarded-For.
  389. */
  390. # $conf['reverse_proxy_header'] = 'HTTP_X_CLUSTER_CLIENT_IP';
  391. /**
  392. * Page caching:
  393. *
  394. * By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page
  395. * views. This tells a HTTP proxy that it may return a page from its local
  396. * cache without contacting the web server, if the user sends the same Cookie
  397. * header as the user who originally requested the cached page. Without "Vary:
  398. * Cookie", authenticated users would also be served the anonymous page from
  399. * the cache. If the site has mostly anonymous users except a few known
  400. * editors/administrators, the Vary header can be omitted. This allows for
  401. * better caching in HTTP proxies (including reverse proxies), i.e. even if
  402. * clients send different cookies, they still get content served from the cache.
  403. * However, authenticated users should access the site directly (i.e. not use an
  404. * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid
  405. * getting cached pages from the proxy.
  406. */
  407. # $conf['omit_vary_cookie'] = TRUE;
  408. /**
  409. * CSS/JS aggregated file gzip compression:
  410. *
  411. * By default, when CSS or JS aggregation and clean URLs are enabled Drupal will
  412. * store a gzip compressed (.gz) copy of the aggregated files. If this file is
  413. * available then rewrite rules in the default .htaccess file will serve these
  414. * files to browsers that accept gzip encoded content. This allows pages to load
  415. * faster for these users and has minimal impact on server load. If you are
  416. * using a webserver other than Apache httpd, or a caching reverse proxy that is
  417. * configured to cache and compress these files itself you may want to uncomment
  418. * one or both of the below lines, which will prevent gzip files being stored.
  419. */
  420. # $conf['css_gzip_compression'] = FALSE;
  421. # $conf['js_gzip_compression'] = FALSE;
  422. /**
  423. * String overrides:
  424. *
  425. * To override specific strings on your site with or without enabling locale
  426. * module, add an entry to this list. This functionality allows you to change
  427. * a small number of your site's default English language interface strings.
  428. *
  429. * Remove the leading hash signs to enable.
  430. */
  431. # $conf['locale_custom_strings_en'][''] = array(
  432. # 'forum' => 'Discussion board',
  433. # '@count min' => '@count minutes',
  434. # );
  435. /**
  436. *
  437. * IP blocking:
  438. *
  439. * To bypass database queries for denied IP addresses, use this setting.
  440. * Drupal queries the {blocked_ips} table by default on every page request
  441. * for both authenticated and anonymous users. This allows the system to
  442. * block IP addresses from within the administrative interface and before any
  443. * modules are loaded. However on high traffic websites you may want to avoid
  444. * this query, allowing you to bypass database access altogether for anonymous
  445. * users under certain caching configurations.
  446. *
  447. * If using this setting, you will need to add back any IP addresses which
  448. * you may have blocked via the administrative interface. Each element of this
  449. * array represents a blocked IP address. Uncommenting the array and leaving it
  450. * empty will have the effect of disabling IP blocking on your site.
  451. *
  452. * Remove the leading hash signs to enable.
  453. */
  454. # $conf['blocked_ips'] = array(
  455. # 'a.b.c.d',
  456. # );
  457. /**
  458. * Fast 404 pages:
  459. *
  460. * Drupal can generate fully themed 404 pages. However, some of these responses
  461. * are for images or other resource files that are not displayed to the user.
  462. * This can waste bandwidth, and also generate server load.
  463. *
  464. * The options below return a simple, fast 404 page for URLs matching a
  465. * specific pattern:
  466. * - 404_fast_paths_exclude: A regular expression to match paths to exclude,
  467. * such as images generated by image styles, or dynamically-resized images.
  468. * If you need to add more paths, you can add '|path' to the expression.
  469. * - 404_fast_paths: A regular expression to match paths that should return a
  470. * simple 404 page, rather than the fully themed 404 page. If you don't have
  471. * any aliases ending in htm or html you can add '|s?html?' to the expression.
  472. * - 404_fast_html: The html to return for simple 404 pages.
  473. *
  474. * Add leading hash signs if you would like to disable this functionality.
  475. */
  476. $conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
  477. $conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
  478. $conf['404_fast_html'] = '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';
  479. /**
  480. * By default, fast 404s are returned as part of the normal page request
  481. * process, which will properly serve valid pages that happen to match and will
  482. * also log actual 404s to the Drupal log. Alternatively you can choose to
  483. * return a 404 now by uncommenting the following line. This will reduce server
  484. * load, but will cause even valid pages that happen to match the pattern to
  485. * return 404s, rather than the actual page. It will also prevent the Drupal
  486. * system log entry. Ensure you understand the effects of this before enabling.
  487. *
  488. * To enable this functionality, remove the leading hash sign below.
  489. */
  490. # drupal_fast_404();
  491. /**
  492. * Authorized file system operations:
  493. *
  494. * The Update Manager module included with Drupal provides a mechanism for
  495. * site administrators to securely install missing updates for the site
  496. * directly through the web user interface by providing either SSH or FTP
  497. * credentials. This allows the site to update the new files as the user who
  498. * owns all the Drupal files, instead of as the user the webserver is running
  499. * as. However, some sites might wish to disable this functionality, and only
  500. * update the code directly via SSH or FTP themselves. This setting completely
  501. * disables all functionality related to these authorized file operations.
  502. *
  503. * Remove the leading hash signs to disable.
  504. */
  505. # $conf['allow_authorize_operations'] = FALSE;
Login or register to post comments