Settings.php: Difference between revisions From Online Manual

Jump to: navigation, search
No edit summary
No edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{TOCright}}
These settings are stored in the Settings.php file in your SMF directory. The format of each option is as follows:
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.
<code>$setting_name = 'value'; # Optional comment.</code>


Where value has any quotation marks (&#039;) or backslash (\) inside it escaped with a backslash (&#039; =&gt; \&#039; and \ =&gt; \\.) The file must also begin with &lt;?php and end with ?&gt;. The file used in the installation package is a good template.
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.


'''$boarddir'''
===$boarddir===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: the directory in which Settings.php is located. </li></ul>
*Version: SMF 1.0+
*Default value: the directory in which Settings.php is located.


This sets the directory where SMF is installed. It&#039;s used to locate files like Settings.php, SSI.php, agreement.txt, and the Packages directory. No trailing slash (/) should be added.
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.


'''$boardurl'''
===$boardurl===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;http://127.0.0.1/smf&#039; </li></ul>
*Version: SMF 1.0+
*Default value: 'http://127.0.0.1/smf'


The URL to your forum&#039;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.
The URL to your forum's directory, 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.


'''$cookiename'''
===$cookiename===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;SMFCookie10&#039; </li></ul>
*Version: SMF 1.0+
*There is no default value; it could be something like 'SMFCookie683'


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


'''$db_error_send'''
==$db_type==
*Version:2.0+
*Default value: mysql


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: 1 </li></ul>
2.0 and higher versions support several different database versions, if you do not know what database type you are using it is suggested not to change this value.
 
===$db_error_send===
 
*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.
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.


'''$db_last_error'''
===$db_last_error===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: (not set) </li></ul>
*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&#039;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.
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. As of 2.1 this has been moved to its own file db_last_error.php and is no longer in the Settings.php file.


'''$db_name'''
===$db_name===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;smf&#039; </li></ul>
*Version: SMF 1.0+
*Default value: 'smf'


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


'''$db_passwd'''
===$db_passwd===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;&#039; </li></ul>
*Version: SMF 1.0+
*Default value: ''


Password for access to the database server. Note that this is always linked to the [http://www.simplemachines.org/community/index.php?action=profile WHERE ID_BOARD NOT IN (14,11);u=3916| username] set in the $db_user setting.
Password for access to the database server. It is not recommended to change this unless the password to the database has actually been changed.


'''$db_persist'''
===$db_persist===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: 0 </li></ul>
*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&#039;t on a dedicated server, this may cause you problems with your host. Please see PHP&#039;s documentation on persistent database connections for more information.
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.


'''$db_prefix'''
===$db_prefix===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;smf_&#039; </li></ul>
*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 &#039;smf_&#039;, the tables will be given the names &#039;smf_attachments&#039;, &#039;smf_boards&#039;, &#039;smf_messages&#039;, etc. If you want to install another [[Forum]] or software package in the same database, simply chose a different prefix, and the tables won&#039;t interfere with each other.
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.


'''$db_show_debug'''
===$db_show_debug===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: (not set) </li></ul>
*Version: SMF 1.0+
*Default value: (not set)


Enables query debugging features. These are very useful for debugging purposes.
If set, enables query debug features -- full text of SQL queries will be displayed before execution. These are very useful for debugging purposes. To enable add <code>$db_show_debug = true;</code> to your Settings.php file before the closing ?>. Keep in mind that once this is enabled the output is shown to everyone.


'''$db_server'''
===$db_server===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;localhost&#039; </li></ul>
*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&#039;s safe (and considerably more efficient!) to use &#039;localhost&#039; 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.
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.


'''$db_user'''
===$db_user===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;root&#039; </li></ul>
*Version: SMF 1.0+
*There is no default for this, it will vary depending on how the admin has it setup.


Name of the database user connecting to the database.
Name of the database user connecting to the database. It is not recommended to use the root user.


'''$language'''
===$language===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;english&#039; </li></ul>
*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&#039;s language files, it will fall back to the file corresponding to this setting.
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.


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


'''$maintenance'''
===$maintenance===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: 0 </li></ul>
*Version: SMF 1.0+
*Default value: 0


Sets whether the [[Forum]] is in maintenance mode or not.
Sets whether the [[Forum]] is in maintenance mode or not.
Value :Description
{{parmdesc|0|d1=Maintainance mode off. The [[Forum]] can be used normally.
0 :Maintainance mode off. The [[Forum]] can be used normally.
|1|d2=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.)
1 :Maintainance mode on. Only administrators can use the [[Forum]] as usual. Other users get a &#039;this [[Forum]] is in maintenance mode&#039; message. The database may still be accessed for user authentication (so as to tell if the [[Member]] is an administrator.)
|2|d3=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.}}
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&#039;s upgrade tool to ensure an undisturbed upgrade.


'''$mbname'''
===$mbname===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;My Community&#039; </li></ul>
*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.
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.


'''$mmessage'''
===$mmessage===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;Okay faithful users...we\&#039;re attempting to restore an older backup of the database...news will be posted once we\&#039;re back!&#039; </li></ul>
*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.
Description of why the [[Forum]] is in maintenance mode. Is shown when the $maintenance setting is set to 1 or 2.


'''$mtitle'''
===$mtitle===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;Maintenance Mode&#039; </li></ul>
*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.
Title for the Maintenance Mode message. Is only shown when the $maintenance setting is set to 1 or 2.


'''$mysql_set_mode'''
===$mysql_set_mode===


<ul class="bbc_list"><li type="disc">Version: SMF 1.1+</li><li type="disc">Default value: (not set) </li></ul>
*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&#039;s best to have this off, if possible, because SMF only expects the defaults, and changing them is another query per page view.
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. This is not present in Settings.php by default.


'''$sourcedir'''
===$sourcedir===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: The Sources sub directory of the path Settings.php is located in. </li></ul>
*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.
The path to where the source files are stored. No trailing slash (/) is allowed.


'''$webmaster_email'''
===$webmaster_email===


<ul class="bbc_list"><li type="disc">Version: SMF 1.0+</li><li type="disc">Default value: &#039;[email protected]&#039; </li></ul>
*Version: SMF 1.0+
*Default value: '[email protected]'


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


[[Category:Settings]]
[[Category:Settings]]
{{As an administrator}}

Latest revision as of 11:16, 3 August 2014

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.

$boarddir

  • 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.

$boardurl

The URL to your forum's directory, 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.

$cookiename

  • Version: SMF 1.0+
  • There is no default value; it could be something like 'SMFCookie683'

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

$db_type

  • Version:2.0+
  • Default value: mysql

2.0 and higher versions support several different database versions, if you do not know what database type you are using it is suggested not to change this value.

$db_error_send

  • 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.

$db_last_error

  • 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. As of 2.1 this has been moved to its own file db_last_error.php and is no longer in the Settings.php file.

$db_name

  • 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.

$db_passwd

  • Version: SMF 1.0+
  • Default value:

Password for access to the database server. It is not recommended to change this unless the password to the database has actually been changed.

$db_persist

  • 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.

$db_prefix

  • 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.

$db_show_debug

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

If set, enables query debug features -- full text of SQL queries will be displayed before execution. These are very useful for debugging purposes. To enable add $db_show_debug = true; to your Settings.php file before the closing ?>. Keep in mind that once this is enabled the output is shown to everyone.

$db_server

  • 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.

$db_user

  • Version: SMF 1.0+
  • There is no default for this, it will vary depending on how the admin has it setup.

Name of the database user connecting to the database. It is not recommended to use the root user.

$language

  • 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.

$maintenance

  • Version: SMF 1.0+
  • Default value: 0

Sets whether the Forum is in maintenance mode or not.

  • 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.


$mbname

  • 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.

$mmessage

  • 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.

$mtitle

  • 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.

$mysql_set_mode

  • 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. This is not present in Settings.php by default.

$sourcedir

  • 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.

$webmaster_email

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

Main

Configuration

Forum

Members

Maintenance

Miscellaneous




Advertisement: