Repair settings.php: Difference between revisions From Online Manual

Jump to: navigation, search
No edit summary
(Marked this version for translation)
(41 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:repair_settings.php}}{{TOCright}}
{{Other languages}}
The tool [[Repair_settings.php]] is a tool to be used to repair some of the more crucial settings for your forum. Simply download this file and upload it to your forum, putting it in the same directory as your Settings.php file.
{{TOCright}}
<translate>
<!--T:1-->
The Repair Settings Tool (''repair_settings.php'') can be used to repair some of the most crucial settings on your forum, such as [[database|database]] information, file paths, and URLs. The tool can be used to repair an SMF installation sufficiently enough so that an [[administrator]] can then log in and fix any other problems.


As always, it might be a good idea to ''backup'' your forum, first. Using this tool shouldn't, ever, cause any problems. But, the internet being the way that it is, you never know. It's always best to be safe, rather than sorry.
<!--T:2-->
'''Backup first!''' - Using this tool should not cause any problems, but it is always better to make a [[backup]], just in case.


Then, navigate with your browser to your usual forum URL. But, instead of "/index.php", point your browser to "/repair_settings.php
==Download the Repair Settings Tool== <!--T:16-->


For example, if your forum's in the root of your site, and your site is at '''www.example.com''' you'd need to navigate to:
<!--T:17-->
You can download the Repair Settings Tool (''repair_settings.php'') from the tools section of the SMF Downloads center: [http://download.simplemachines.org/index.php?thanks;filename=repair_settings.php repair_settings.php].


http://www.example.com/repair_settings.php
==Using the Repair Settings Tool== <!--T:18-->


If it's in a sub-directory named, say "forum", you'd need to navigate to:
<!--T:3-->
Upload the file ''repair_settings.php'' with an [[FTP_-_How_do_I_use_FTP|FTP client]] to the root directory of your forum  (where ''Settings.php'' can be found). Navigate with your browser to your usual forum URL, but instead of ''yoursitename/index.php'', direct your browser to ''yoursitename/repair_settings.php''.


http://www.example.com/forum/repair_settings.php
<!--T:19-->
For example, if your forum is in the root directory of your site, and your site is at ''<nowiki>www.example.com</nowiki>'' you need to go to: ''<nowiki>http://www.example.com/repair_settings.php</nowiki>''. If it is located in a sub-directory named, for example ''forum'', you need to go to: ''<nowiki>http://www.example.com/forum/repair_settings.php</nowiki>''.


This script allows you to change the most important settings such as MySQL information, file paths and urls, and can be used when SMF is not working at all. That is what it is mostly used for: repairing your SMF enough so that an admin user can login and fix any other problems.
<!--T:15-->
'''ATTENTION:''' The ''repair_settings.php'' tool displays sensitive information about your server setup, namely the database user and password. Make sure that you delete it once you have finished the maintenance!


Using repair_settings.php is easy: simply upload the file to the root directory of your forum with FTP and then access the page in your browser. Once you have finished the maintenance, remember to delete the file. If you do not delete the file, you will leave your forum vulnerable!
==Settings that can be repaired== <!--T:5-->


=== Settings the tool can repair ===
<!--T:6-->
For more information on each of these settings, please see [[server settings]].
In most cases, the Repair Settings Tool can detect the correct value for each of the fields and settings listed below. The tool will display a link under each item with a recommended value; clicking these links will update the corresponding text box fields with the recommended value. If you want the recommended value to be used for all of the settings on the page, scroll down to the bottom of the page and click on the link ''Restore all settings''. Be careful though, because SMF will not always guess the values correctly if the server is configured unusually.
==== Critical Settings ====
* '''Maintenance Mode''' - You can turn maintenance mode on your forum on and off and also make it completely unusable.
* '''Language File''' - Change the language of your forum.
* '''Cookie Name''' - Change the name of the cookie that your forum creates for the user's browsers.
* '''Queryless URLs''' - Turn the use of queries in the forum's urls on and off ("index.php/topic,1.0.html" vs. "index.php?topic=1.0")
* '''Output Compression''' - Can turn output compression on and off.
* '''Database driven sessions''' - Can set whether sessions are managed by the database or not.


==== MySQL Settings ====
===Critical Settings=== <!--T:7-->
* '''Includes all of the typical settings that are needed to connect to the database''' - MySQL server address, MySQL database name, MySQL username, MySQL password, and MySQL table prefix.
* '''MySQL connection type''' - Can be set to Persistent or Standard.


==== Paths &amp; URLs ====
<!--T:8-->
* '''Allows you set set the paths for''' - Forum URL, Forum Directory, Sources Directory, Attachment Directory, Avatar URL, Avatar Directory, Smileys URL, Smileys Directory, Default Theme URL, Default Theme Images URL, and Default Theme Directory.
* '''Maintenance Mode''' - You can choose to turn [[maintenance mode]] on or off for your forum, and it is also possible to make your forum completely unusable (inaccessible even to administrators).
* '''Language File''' - This changes the language of your forum.</translate>
<translate>
<!--T:20-->
* '''Cookie Name''' - This changes the name of the [[Settings.php#.24cookiename|cookie]] that your forum creates for the user's browser.
* '''Queryless URLs''' - Turns the use of queries in the forum's URLs on and off (''../index.php/topic,1.0.html'' compared to ''../index.php?topic=1.0''). In the Admin Center, this setting is referred to as [[SMF2.0:Features_and_Options#General|Search engine friendly URLs]].</translate>
<translate>
<!--T:21-->
* '''Output Compression''' - Turns output compression on and off.
* '''Database driven sessions''' - Sets whether sessions are managed by the database.
*'''Set SMF default theme as overall forum default for all users''' - This will override the [[Profile#Look_and_Layout|theme preference]] in the profiles of all users.


If you use multiple attachment directories in smf 2.*, do NOT use this version of repair_settings.php as it does not support multiple attachment directories. You need to use  [https://github.com/downloads/emanuele45/tools/repair_settings.zip this version] instead.
===Database Settings=== <!--T:9-->


Please note that this DOES NOT correct the paths for custom themes, because the tool is not updated to locate the names and paths of custom themes. Those paths have to be set in the admin panel, under themes and layout>Theme settings. At the bottom of the page, click "Attempt to reset all themes" and the paths will be updated, automatically. Please note, though, that with the use of this script, and clicking the link to reset your default theme paths, you will set all of your users to the default theme.
<!--T:22-->
This section includes all of the typical settings that are needed to connect to the [[database]] of your forum:
If you wish to try out the new "Work in progress" version of this script, to have it fix your custom themes directories and a few other tweaks, download the version [https://github.com/downloads/emanuele45/tools/repair_settings.zip here]. This updated version of the script will allow you to keep your custom theme as default and NOT reset to the default theme, unless you select the option. Please remember this version is not officially supported by the SMF team, at this time. So, use this version at your own risk and let's stress the fact that you REALLY ought to backup, before using this tool.


=== Recommended values ===
<!--T:23-->
In most cases, SMF can detect the correct value for each of the fields and settings. Underneath many of the settings is a link with with the recommended value. Clicking these links will update the corresponding textbox fields with the recommended value. Be careful though, because SMF will not always guess correctly if the server is configured unusually.
*'''Server'''
*'''Database name'''
*'''Username'''
*'''Password'''
</translate>
{{ {{Localized|Version specific}}|small=yes|version=2.0+|content=
<translate>
<!--T:24-->
*'''SSI Username''' (optional)
*'''SSI Password''' (optional)</translate>}}
<translate>
<!--T:25-->
*'''Table prefix'''
*'''Connection Type''' (''Standard'' or ''Persistent'')


=== Download ===
<!--T:26-->
The repair_settings.php modules can be downloaded at the SMF download page: ''[http://download.simplemachines.org/ Download] > [http://download.simplemachines.org/?tools Tools] >'' '''[http://download.simplemachines.org/index.php?thanks;filename=repair_settings.php repair_settings.php]'''
If you are unsure about any of the above settings, please contact your host.


[[Category:Tools]]
===Paths & URLs=== <!--T:10-->
 
<!--T:27-->
In this section, you can check that the directory paths and URLs are set correctly for your forum:
 
<!--T:28-->
*'''Forum URL'''
*'''Forum Directory'''
*'''Sources Directory'''
</translate>
{{ {{Localized|Version specific}}|small=yes|version=2.0+|content=
<translate>
<!--T:29-->
*'''Cache Directory'''</translate>}}
<translate>
<!--T:30-->
*'''Attachment Directory'''
*'''Avatar URL'''</translate>
<translate>
<!--T:31-->
*'''Avatar Directory'''
*'''Smileys URL'''
*'''Smileys Directory'''
 
<!--T:32-->
For more information on each of the settings above, please see [[Server settings]].
 
===Paths & URLs for Themes=== <!--T:33-->
 
<!--T:34-->
This section enables you to check that the directory paths and URLs are correct for the default theme as well as for any other themes that you have installed.
 
<!--T:11-->
The Repair Settings Tool will allow you to keep your custom theme as default and not reset to the default theme, unless you select the option ''Set SMF default theme as overall forum default for all users'', which is found in the [[Repair_settings.php#Critical_Settings|Critical Settings]] as mentioned above.
 
==Options== <!--T:12-->
 
<!--T:35-->
The following options appear at the bottom of the page when using the Repair Settings Tool:
 
<!--T:36-->
*'''Restore all settings''' - This changes all the settings to the ''recommended values'', which saves you the effort of clicking on each individual link for the recommended values (as found below each setting). As mentioned above, there is no guarantee that the tool will detect all of the correct settings, so you should use this button with caution.
</translate>
{{ {{Localized|Version specific}}|small=yes|version=2.0+|content=
<translate>
<!--T:37-->
*'''Remove all hooks''' - If [[Modification_(term)|mods]] have installed [[Integration hooks|hooks]] and a clean install is desired, clicking ''Remove all hooks'' will ensure that all mods have all elements removed/disabled. Do not use this button unless you know what you are doing.</translate>}}
<translate>
<!--T:38-->
*'''Remove this file. Careful, it may not work in all servers!''' - If you click this button, the tool will attempt to delete the file ''repair_settings.php'' in the root directory of your SMF installation. This is for security reasons. You might have to delete the file manually with your FTP client, though.
*'''Save Settings''' - Don't forget to click on this button in order to save the changes that you have made.
 
==Important Note== <!--T:14-->
 
<!--T:39-->
If you are using a different set of database details (perhaps due to moving your forum, or because you are trying to set up a secondary or test forum), make sure you use the Repair Settings Tool in the following order:
 
<!--T:40-->
#Run the Repair Settings Tool and make changes <u>only</u> in the database section. You must save the updated database settings ''before'' you do anything else.
#Run the Repair Settings Tool again. Now you can adjust the directory paths and URLs for your forum.
 
<!--T:41-->
It is important to use the tool in the above order because some of the directory paths and URLs (such as those for attachments, avatars, and smileys) are stored in the database. This means that if you attempt to change these paths and URLs before you have reset your forum to use the new database, you will in fact be making changes to the old forum database.
</translate>
[[Category:FAQ{{Langcat|{{BASEPAGENAME}}}}]]

Revision as of 20:31, 1 September 2014

Languages English  · español · italiano

The Repair Settings Tool (repair_settings.php) can be used to repair some of the most crucial settings on your forum, such as database information, file paths, and URLs. The tool can be used to repair an SMF installation sufficiently enough so that an administrator can then log in and fix any other problems.

Backup first! - Using this tool should not cause any problems, but it is always better to make a backup, just in case.

Download the Repair Settings Tool

You can download the Repair Settings Tool (repair_settings.php) from the tools section of the SMF Downloads center: repair_settings.php.

Using the Repair Settings Tool

Upload the file repair_settings.php with an FTP client to the root directory of your forum (where Settings.php can be found). Navigate with your browser to your usual forum URL, but instead of yoursitename/index.php, direct your browser to yoursitename/repair_settings.php.

For example, if your forum is in the root directory of your site, and your site is at www.example.com you need to go to: http://www.example.com/repair_settings.php. If it is located in a sub-directory named, for example forum, you need to go to: http://www.example.com/forum/repair_settings.php.

ATTENTION: The repair_settings.php tool displays sensitive information about your server setup, namely the database user and password. Make sure that you delete it once you have finished the maintenance!

Settings that can be repaired

In most cases, the Repair Settings Tool can detect the correct value for each of the fields and settings listed below. The tool will display a link under each item with a recommended value; clicking these links will update the corresponding text box fields with the recommended value. If you want the recommended value to be used for all of the settings on the page, scroll down to the bottom of the page and click on the link Restore all settings. Be careful though, because SMF will not always guess the values correctly if the server is configured unusually.

Critical Settings

  • Maintenance Mode - You can choose to turn maintenance mode on or off for your forum, and it is also possible to make your forum completely unusable (inaccessible even to administrators).
  • Language File - This changes the language of your forum.
  • Cookie Name - This changes the name of the cookie that your forum creates for the user's browser.
  • Queryless URLs - Turns the use of queries in the forum's URLs on and off (../index.php/topic,1.0.html compared to ../index.php?topic=1.0). In the Admin Center, this setting is referred to as Search engine friendly URLs.
  • Output Compression - Turns output compression on and off.
  • Database driven sessions - Sets whether sessions are managed by the database.
  • Set SMF default theme as overall forum default for all users - This will override the theme preference in the profiles of all users.

Database Settings

This section includes all of the typical settings that are needed to connect to the database of your forum:

  • Server
  • Database name
  • Username
  • Password
  • SSI Username (optional)
  • SSI Password (optional)
  • Table prefix
  • Connection Type (Standard or Persistent)

If you are unsure about any of the above settings, please contact your host.

Paths & URLs

In this section, you can check that the directory paths and URLs are set correctly for your forum:

  • Forum URL
  • Forum Directory
  • Sources Directory
  • Cache Directory
  • Attachment Directory
  • Avatar URL
  • Avatar Directory
  • Smileys URL
  • Smileys Directory

For more information on each of the settings above, please see Server settings.

Paths & URLs for Themes

This section enables you to check that the directory paths and URLs are correct for the default theme as well as for any other themes that you have installed.

The Repair Settings Tool will allow you to keep your custom theme as default and not reset to the default theme, unless you select the option Set SMF default theme as overall forum default for all users, which is found in the Critical Settings as mentioned above.

Options

The following options appear at the bottom of the page when using the Repair Settings Tool:

  • Restore all settings - This changes all the settings to the recommended values, which saves you the effort of clicking on each individual link for the recommended values (as found below each setting). As mentioned above, there is no guarantee that the tool will detect all of the correct settings, so you should use this button with caution.
  • Remove all hooks - If mods have installed hooks and a clean install is desired, clicking Remove all hooks will ensure that all mods have all elements removed/disabled. Do not use this button unless you know what you are doing.
  • Remove this file. Careful, it may not work in all servers! - If you click this button, the tool will attempt to delete the file repair_settings.php in the root directory of your SMF installation. This is for security reasons. You might have to delete the file manually with your FTP client, though.
  • Save Settings - Don't forget to click on this button in order to save the changes that you have made.

Important Note

If you are using a different set of database details (perhaps due to moving your forum, or because you are trying to set up a secondary or test forum), make sure you use the Repair Settings Tool in the following order:

  1. Run the Repair Settings Tool and make changes only in the database section. You must save the updated database settings before you do anything else.
  2. Run the Repair Settings Tool again. Now you can adjust the directory paths and URLs for your forum.

It is important to use the tool in the above order because some of the directory paths and URLs (such as those for attachments, avatars, and smileys) are stored in the database. This means that if you attempt to change these paths and URLs before you have reset your forum to use the new database, you will in fact be making changes to the old forum database.



Advertisement: