Difference between revisions of "Settings.php"

From Online Manual

Jump to: navigation, search
m (1 revision)
m (2 revisions: Importing from local.)
(No difference)

Revision as of 15:41, 5 November 2009

These settings are stored in the Settings.php file in your SMF directory. The format of each option is as follows:

$setting_name = 'value';::# Optional comment.

Where value has any quotation marks (') or backslash (\) inside it escaped with a backslash (' => \' and \ => \\.) The file must also begin with <?php and end with ?>. The file used in the installation package is a good template.


  • Version: SMF 1.0+
  • Default value: the directory in which Settings.php is located.

This sets the directory where SMF is installed. It's used to locate files like Settings.php, SSI.php, agreement.txt, and the Packages directory. No trailing slash (/) should be added.


The URL to your forum's folder, without the trailing slash (/). This URL is used throughout SMF - all dynamically generated URLs (except those with their own settings) are based on this setting.


  • Version: SMF 1.0+
  • Default value: 'SMFCookie10'

Name of the cookie to set for authentication purposes. Changing this value will cause everyone to be logged out.


  • Version: SMF 1.0+
  • Default value: 1

Enables (1) or disables (0) sending an email to the Administrator on a database connection or query error. This function is limited to sending only one email per every three days. The email address it sends to is configured by the $webmaster_email setting.


  • Version: SMF 1.0+
  • Default value: (not set)

A variable, which stores the Timestamp of the last database connection error. This is not really a setting (and isn't set by default), but merely an internally used variable to prevent multiple emails from being sent after a connection error. See also the $db_error_send setting.


  • Version: SMF 1.0+
  • Default value: 'smf'

The name of the database. This database must exist, and must have SMF's tables and data in it.


  • Version: SMF 1.0+
  • Default value: ''

Password for access to the database server. Note that this is always linked to the WHERE ID_BOARD NOT IN (14,11);u=3916| username set in the $db_user setting.


  • Version: SMF 1.0+
  • Default value: 0

Enable (1) or disable (0) persistent connections for connecting to the database. A persistent connection keeps the connection active to increase performance (although in many cases the gain is minimal.) If you aren't on a dedicated server, this may cause you problems with your host. Please see PHP's documentation on persistent database connections for more information.


  • Version: SMF 1.0+
  • Default value: 'smf_'

The prefix of the database tables. During installation, SMF will add about 30 tables to the database. Each of which will use the prefix that was configured during the installation procedure. For example, if the prefix is 'smf_', the tables will be given the names 'smf_attachments', 'smf_boards', 'smf_messages', etc. If you want to install another Forum or software package in the same database, simply chose a different prefix, and the tables won't interfere with each other.


  • Version: SMF 1.0+
  • Default value: (not set)

Enables query debugging features. These are very useful for debugging purposes.


  • Version: SMF 1.0+
  • Default value: 'localhost'

Hostname or IP of the database server. If the database server is on the same machine as the webserver, it's safe (and considerably more efficient!) to use 'localhost' for this setting. Otherwise, either an IP address or a web address (hostname) is required. Note that database specifically requires the hostname connecting to the database server to be granted permission to connect.


  • Version: SMF 1.0+
  • Default value: 'root'

Name of the database user connecting to the database.


  • Version: SMF 1.0+
  • Default value: 'english'

The default language file set for the forum. This language will be used for all guests (unless they choose otherwise) and members who have not chosen a language in their profile. SMF will always try to get the language file of the language set by a user first. If a language file for some reason cannot be found in the user's language files, it will fall back to the file corresponding to this setting.

    Tip: Adding ?language=xyz; after index.php allows guests to choose a language, if it is installed.


  • Version: SMF 1.0+
  • Default value: 0

Sets whether the Forum is in maintenance mode or not. Value :Description 0 :Maintainance mode off. The Forum can be used normally. 1 :Maintainance mode on. Only administrators can use the Forum as usual. Other users get a 'this Forum is in maintenance mode' message. The database may still be accessed for user authentication (so as to tell if the Member is an administrator.) 2 :Maintainance mode on, full force. Freezes the forum. No one can access it, not even administrators. This setting will leave the database untouched (as far as the SMF Forum is concerned) but cannot be set from the administration center. This setting is used by SMF's upgrade tool to ensure an undisturbed upgrade.


  • Version: SMF 1.0+
  • Default value: 'My Community'

The name of your forum. This is used in the title and footer of your Forum pages, as the name of the sender of email notifications and on the footer of each email message sent by your forum.


  • Version: SMF 1.0+
  • Default value: 'Okay faithful users...we\'re attempting to restore an older backup of the database...news will be posted once we\'re back!'

Description of why the Forum is in maintenance mode. Is shown when the $maintenance setting is set to 1 or 2.


  • Version: SMF 1.0+
  • Default value: 'Maintenance Mode'

Title for the Maintenance Mode message. Is only shown when the $maintenance setting is set to 1 or 2.


  • Version: SMF 1.1+
  • Default value: (not set)

If this is set to true (not in quotes) SMF will automatically set the sql_mode and AUTOCOMMIT to those options which it expects. It's best to have this off, if possible, because SMF only expects the defaults, and changing them is another query per page view.


  • Version: SMF 1.0+
  • Default value: The Sources sub directory of the path Settings.php is located in.

The path to where the source files are stored. No trailing slash (/) is allowed.


  • Version: SMF 1.0+
  • Default value: 'noreply@myserver.com'

Email address from which to send all Topic notifications, Personal message notifications, newsletters, etc. This address also receives database error warnings, should they occur.