手册:AdminSettings.php
此功能已在版本1.23中完全移除。 |
MediaWiki文件: AdminSettings.php | |
---|---|
位置: | / |
源代码: | 未在Git中 (created by user) |
类: |
详情
The requirement for AdminSettings.php
(along with supporting file AdminSettings.sample
) was rudimentarily removed in MediaWiki 1.16.
Prior to MediaWiki 1.16, AdminSettings.php
was used to store database authentication credentials for maintenance scripts and to control the availability of profileinfo.php
.
It has finally been removed completely in MediaWiki 1.23.
升级
If upgrading from a pre-1.16 version of MediaWiki to version 1.16 or later, the variables set in AdminSettings.php
file can be safely removed.
AdminSettings.php
不再需要。
If it still exists, it will be loaded by maintenance scripts to retain backward compatibility.
1.16版以前
Manually create AdminSettings.php
in the root directory of the MediaWiki installation.
Typically, this is done by renaming AdminSettings.sample
to AdminSettings.php
and then editing AdminSettings.php
appropriately.
AdminSettings.php
should set three variables:
$wgDBadminuser
- the name of a database account that has sufficient privileges to run the database maintenance scripts. For MySQL databases, this account should have "superuser" privileges. For PostgreSQL databases, this account should be the same account used for $wgDBuser .$wgDBadminpassword
- the password for the$wgDBadminuser
account.$wgEnableProfileInfo
- controls the availability ofprofileinfo.php
.
示例
<?php
/* Database authentication credentials */
$wgDBadminuser = 'wikiadmin';
$wgDBadminpassword = 'adminpass';
/* Whether to enable the profileinfo.php script. */
$wgEnableProfileInfo = false;
?>
安全性
AdminSettings.php contains sensitive information (account names and passwords) that can help an attacker compromise your database management system. Ensure that you've taken the relevant preventative measures listed in 手册:安全 and 手册:保护数据库密码 .
PostgreSQL-specific issues
If using PostgreSQL with your MediaWiki installation, the authentication credentials used for $wgDBadminuser
and $wgDBadminpassword
should be the same as the credentials used for $wgDBuser
and $wgDBpassword
.
This is necessary to ensure that the owner for new tables is set correctly.