Manual:LocalSettings.php/el

Το αρχείο αυτό διατηρεί τις τοπικές ρυθμίσεις διαμόρφωσης (βασισμένες στο αρχείο ) μιας εγκατάστασης MediaWiki. Θα ήταν συνετό να διαβάσει και βεβαιωθεί κανείς πως οι ρυθμίσεις είναι σωστές. Το αρχείο συνήθως δημιουργείται κατά τη διάρκεια της εγκατάστασης μέσω αλλά είναι πιθανό να χρειαστούν κάποιες μετατροπές, ίσως σε συνδυασμό με τις ρυθμίσεις του Apache.

Αλλάζοντας μια ρύθμιση συνήθως σημαίνει πως αλλάζει η τιμή μιας μεταβλητής PHP. Ίσως να θέλετε να μάθετε καλύτερα τη σύνταξη της γλώσσας PHP πριν προχωρήστε. Σαν γενικός κανόνας, να ξέρετε πως η μεταβλητές PHP διαβάζονται προσθέτοντας το χαρακτήρα "$" πριν από το όνομα της μεταβλητής - πολλές μεταβλητές απλά θέτονται ως  (αληθές) ή   (ψευδές).

Οποιεσδήποτε αλλαγές θα έχουν ισχύ αμέσως μετά τη αποθήκευση του αρχείου: δε χρειάζεται να γίνει επανεκκίνηση. Σε μερικές περιπτώσεις ίσως χρειαστεί να καθαριστεί η τοπική μνήμη του φυλλομετρητή.

Οι αρχικές τιμές πολλών άλλων ρυθμίσεων βρίσκονται στο αρχείο includes/DefaultSettings.php, που δεν πρέπει να αλλάζει - αν η μεταβλητή που θέλετε να αλλάξετε δεν ορίζεται στο αρχείο LocalSettings.php, αντιγράψτε την αντίστοιχη γραμμή από το DefaultSettings και κάντε την αλλαγή που θέλετε. Μέσα στο LocalSettings.php μπορείτε να προσθέστε νέες γραμμές στο τέλος. Όλες αυτές οι γραμμές θα πρέπει να βρίσκονται πιο κάτω απο τη γραμμή που λέει 'require_once( "includes/DefaultSettings.php" );'

Μέσα στο αρχείο μπορεί να βρίσκονται γραμμές όπως 'require_once( "extensions/extension.php" );', που συνδέονται με άλλες επεκτάσεις ενεργοποιημένες στο wiki. Αυτές οι επεκτάσεις ίσως να χρειάζονται την αλλαγή των τιμών άλλων μεταβλητών στο LocalSettings.php - δείτε το κείμενο που συνοδεύει την επέκταση για περισσότερες πληροφορίες. Ένας κατάλογος επεκτάσεων υπάρχει στον πίνακα επεκτάσεων.


 * Μη τοποθετείτε επεκτάσεις πριν τη γραμμή require_once( "includes/DefaultSettings.php" ); - αυτό θα ακυρώσει την εγγραφή της επέκτασης με αποτέλεσμα να μη δουλεύει και ίσως προκαλέσει το wiki σας να μην είναι προσπελάσιμο.

Η έκδοσή σας του αρχείου LocalSettings.php</tt> ίσως να μη λήγει με τον PHP κωδικό ?&gt;</tt>. Αυτό έγινε επίτηδες γιατί προτρέπει από το να προστεθούν γραμμές μετά τον κωδικό αυτόν κατα λάθος. Το PHP θα λειτουργήσει χωρίς κανένα πρόβλημα.

Δείτε τον κατάλογο ρυθμίσεων διαμόρφωσης και τα σχόλια στα διάφορα αρχεία για περισσότερες πληροφορίες σχετικά με τις μεταβλητές. Μια μικρή λίστα με τις πιο σημαντικές μεταβλητές βρίσκεται παρακάτω.

Εαν έχετε ένα wiki σε μια βικιφάρμα του MediaWiki ίσως να μην έχετε πρόσβαση εγγραφής (write-access) (ίσως ούτε και πρόσβαση ανάγνωσης) στο αρχείο LocalSettings.php (δείτε π.χ.). Η εταιρεία βικιφάρμας ίσως να μπορεί να κάνει τις αλλαγές που επιθυμείτε, αλλά μπορεί και όχι. Είναι πολύ πιθανό να θέλει να διατηρήσει τις ίδιες ρυθμίσεις για όλα τα wiki της φάρμας.

Διάδρομος προσθήκης (Include path)
The $IP (include path) variable holds the local file path to the base installation of your wiki. Make sure you refer to the fully qualified file path. Do not include a slash at the end of the path.

The DefaultSettings.php file gets loaded from the directory designated by the IP variable.

Site name
The $wgSitename variable holds the name of your wiki setup. This name gets included many times throughout the system. For instance, the Wikipedia tagline "'From Wikipedia, the free encyclopedia."' makes use of this setting.

Site language
The $wgLanguageCode variable controls the language of your wiki's interface. While users can switch the language they see in their preferences, this variable sets the default language that all anonymous users and most registered users see.

Script path
$wgScriptPath is the URL path prefix to access the main MediaWiki script that is the central acting piece of code of MediaWiki. This setting should correspond to the Apache settings, especially if you are using Apache's rewrite rules.

Server name
$wgServer can be used optionally to overwrite the automatic detection. When the wiki is accessed from either the localhost where it runs, from an intranet or from the internet, e-mail notifications and a few other computed messages would be usually delivered with the different URLs. Using  overwrites the detection and the server name will be constant.

If www.example.com is the server address of your wiki as seen from the internet, add a line such as

The magic word variable  can be used on wiki pages; it equals the value of.

Script name
$wgScript is the name of the main (index) MediaWiki PHP script, named index.php</tt> by default. Changing the script name is probably not a good idea. However, if you feel the urge to do so, this is the place to make your changes. Make sure you know what you are doing.

Redirect script name
The $wgRedirectScript variable specifies the URL path to the redirect script which handles redirects in MediaWiki. This setting is similar to wgScript as you can configure the exact name of the script. As mentioned above, this is probably not a good idea unless you really know what you are doing.

Article path
$wgArticlePath is the path to use when accessing a page in MediaWiki. The path should contain the path to the main script (usually making use of ) and use the $1</tt> placeholder for the article name.

If you are using Apache rewrite rules to create pretty and short URLs, you probably need to adjust  to address the right path. Note that wgArticlePath is used to construct URLs from within MediaWiki. If you make a mistake here, internal links will show up incorrectly while you still may be able to access the main page by specifying the correct URL manually.

Typical values are:

Stylesheet location
Use the $wgStylePath variable to set the URL path to the place where the stylesheets (CSS) for the MediaWiki installation are located. The $wgStyleDirectory variable should point the same place, but note that this is a local file system path for use in internal scripts accessing the file system.

Upload location
The upload directory is the place where files uploaded by the users are stored. The $wgUploadPath variable specifies the URL path, the $wgUploadDirectory points to the local file system path.

Logo
The $wgLogo variable specifies the relative URL pointing to the graphical logo that gets displayed on the top left corner by default. You might want to point the variable to the Upload Directory to be able to exchange the logo by updating uploaded files.

is usually.

Contact info
The $wgEmergencyContact variable is the e-mail address of the user to contact when things happen. This e-mail address is used to send internal bug reports to. As an administrator, you want to include your e-mail address here.

The $wgPasswordSender variable is the e-mail address where e-mail gets sent from, when passwords are sent out to users who have forgotten their passwords. Choose an address people can reply to in case of trouble or confusion.

Database settings
MediaWiki needs access to the database (currently either MySQL or PostgreSQL) to store pages, modifications, user information, and a lot more things.

The $wgDBserver contains the hostname where the database is hosted on. In most cases this will be just "localhost" as the database is run on the same system, but for distributed installations, you need to fill in the fully qualified domain name of the computer running the database.

$wgDBname is the database name of the database to be used by MediaWiki. A single MySQL or PostgreSQL installation can store more than one database and you can even run many MediaWiki installations on a single server. Make sure you have stated the correct database name here and use different database names for different wiki installations on the same database server.

The $wgDBuser and $wgDBpassword variables contain the login name and password to be used by MediaWiki to access the database. Make sure the specified user has the proper access rights to be able to manipulate the wiki's table on the database server.

Also keep in mind that the LocalSettings.php permissions should not allow other users to view this file as it contains security-related data.

User rights
The $wgGroupPermissions is an associative array, controlling permissions for creating and editing pages for your different user groups. In this array, custom permission levels can be created, and permission levels for the different user groups can be set. See Help:User rights for more information about the different permissions and user groups available.

Force capital links
By default, no page name can start with a lowercase Roman letter: in an attempt to do so the first letter is converted to uppercase; if a link target, included page, image or category is specified with a name starting with a lowercase letter, the actual target etc. is the page starting with the corresponding capital.

Alternatively page names can start with a lowercase letter, in addition to the possibilities of starting with a capital, a digit, etc. For that you must adjust the $wgCapitalLinks variable. Setting it to false allows lowercase characters, true chooses the default behaviour.

Enabling subpages
Subpages are enabled on a per-namespace basis using the $wgNamespacesWithSubpages variable. For example, to enable subpages in the main namespace:

Image uploads
Before users are allowed to upload files to the MediaWiki system, you have to enable that feature. Make sure the Upload Directory is properly configured and writeable by the Apache web server process. Then set the $wgEnableUploads variable to true to allow uploading in the web user interface.

i.e. Here's some example code from includes/DefaultSettings.php to put in LocalSettings.php. If you want to be able to resize images on the fly to support thumbnails, MediaWiki needs a working ImageMagick installation. Set the $wgUseImageResize and $wgUseImageMagick variables to true once you have installed and tested ImageMagick on your system. Make sure the $wgImageMagickConvertCommand variable points to the proper location of the convert</tt> command of your installation and that the command is executable by the web server process.

Also, you may want to modify the list of accepted extensions, which is stored within the $wgFileExtensions array:

In case you run into trouble with ImageMagick, and obtain the following error message:
 * Fatal error: mime_magic could not be initialized, magic file is not available in includes/MimeMagic.php on line 506</tt>

Try adding the following line to LocalSettings.php: $wgMimeDetectorCommand = "file -bi";

See also: Manual:Configuring file uploads, Manual:Mime type detection, and Manual:Image thumbnailing

LaTeX inline equations
In order to render mathematical formulae in LaTeX, you need a working LaTeX installation on your system. Set the $wgUseTeX variable to true to enable that feature. Also make sure the $wgMathPath, $wgMathDirectory and $wgTmpDirectory are set properly, but you might want to go with the default values unless you have a very good reason to change it.

Interwiki support
InterWiki support is built into MediaWiki but you need to configure the prefix to be used for your internal links. This prefix is usually the same as $wgSitename, but in case you need to change that, you set the $wgLocalInterwiki variable to the preferred name.

Language of user interface
MediaWiki allows for a variety of localized user interfaces languages instead of the english default. If you want to run your wiki in a non-English language, set the $wgLanguageCode variable to the proper language code (e.g. "de" for German, "es" for Spanish, etc.)

You may use any of the languages found in the directory language. E.g., if you find MessagesEs.php, you can use " " for Spanish. Do not use " " with a capital letter. Although it seems to work, not all texts are translated.

Note: After changing the language code, you will need to run a php script to make it work. With your command line tool, go to your wiki directory, open the "maintenance" folder, and type " ". Please note that on Windows, the PHP folder might not be included in the PATH environment variable.

Setting copyright for the site

 * $wgRightsPage is the page on the wiki that covers the copyrights that it falls under. Usually, this will be Project:Copyrights.
 * $wgRightsText is the text in the footer that follows "Content is available under". It will be linked to the page specified in.
 * $wgRightsIcon is the URL of the image placed at the left of the footer.
 * $wgRightsUrl is the page describing full details of your license. (For the GNU FDL, for example, this would be .)
 * Note: If  is non-empty, the link in the copyright/license notice will link to that page on your site. If   is empty then the copyright/license notice will link to   instead.
 * $wgEnableDublinCoreRdf and $wgEnableCreativeCommonsRdf to add RDF meta data to wiki pages. For more details about RDF metadata see RDF metadata.

To modify the copyright statements of the site, add something like this to LocalSettings.php: Afterwards, edit MediaWiki:Copyright to provide an appropriate message, using  to indicate the position where the link to your copyright page will be.

Example: setting a Creative Commons license

To set a Creative Commons license do the following:


 * Choose your license: http://creativecommons.org/text/publish-website
 * Examine the returned HTML code, e.g.:

<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/"> <img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png" /> </a> This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/"> Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License</a>.


 * For  enter the href info from the first anchor:
 * For  enter the text the second anchor links from (add the "a" to the Wiki variable for a more grammatically correct version)
 * For  enter the src info from the img link in the first anchor. You want to copy the badge to your own site instead of using the one from the Creative Commons site.


 * For using RDF metadata about copyright add one or both of the following lines to your LocalSettings.php

Custom namespaces
By declaring the $wgExtraNamespaces array, and modifying the $wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefault arrays, extra namespaces can be added to a MediaWiki installation. See Custom namespaces for more information as to how to do so.

Skins
The default skin of the site can be modified via the $wgDefaultSkin variable.