手册:install.php(安装程序)

This page is a translated version of the page Manual:Install.php and the translation is 98% complete.
Outdated translations are marked like this.

详情

install.php文件是用于MediaWikiInstallation和配置的基于CLI的维护脚本

此脚本创建一个新的LocalSettings.php。 如果LocalSettings.php文件已存在,并且无法从该文件中读取现有设置,则它将中止。


用法

php install.php [--conf|--confpath|--dbgroupdefault|--dbname|--dbpass|--dbpassfile|--dbpath|--dbport|--dbprefix|--dbschema|--dbserver|--dbtype|--dbuser|--env-checks|--globals|--help|--installdbpass|--installdbuser|--lang|--memory-limit|--pass|--passfile|--profiler|--quiet|--scriptpath|--server|--skins|--wiki|--with-extensions] <name> <admin>

The tables below explain the various options and arguments. The default values for the options are indicated in parentheses.

通用维护参数:

--help (-h) 显示此帮助消息
--quiet (-q) 是否取消无错误输出
--conf LocalSettings.php的位置,如果不是默认的 此设置对此脚本没有影响,将被忽略。
--wiki 用于指定维基ID
--globals 处理结束时输出全局变量以进行调试
--memory-limit 为脚本设置特定的内存限制,“max”表示没有限制,“Default”表示避免更改
--server 要在URL中使用的协议和服务器名称,例如https://en.wikipedia.org。这有时是必要的,因为在命令行脚本中服务器名称检测可能会失败。
--profiler 探查器输出格式(通常为“文本”)

脚本相关参数

--dbuser 要用于此脚本的数据库用户。对于$wgDBuser ,此值显示在LocalSettings.php 中。如果给定--installdbuser--installdbpass,则该值将用于创建新帐户
--dbpass 用于此脚本的密码。该值出现在LocalSettings.php 中,表示$wgDBpassword 。如果给定‘--installdbuser’和‘--installdbpass’,则该值将用于创建新帐户
--dbgroupdefault 要使用的默认数据库组

脚本特定参数

--confpath 要将LocalSettings.php写入的路径 (/var/www/)
--dbname 数据库名称 (my_wiki)
--dbpassfile 提供DBPASS选项的另一种方法,因为此文件的内容
--dbpath SQLite数据库的路径 ($IP/data)
--dbport 数据库端口;仅适用于PostgreSQL (5432)
--dbprefix (可选的)数据库表名前缀
--dbschema PostgreSQL/Microsoft SQL Server中MediaWiki数据库的模式 (mediawiki)
--dbserver 数据库主机 (localhost)
--dbtype 数据库类别 (mysql)
--env-checks 仅运行环境检查,不更改任何内容
--installdbpass 数据库用户安装为的密码
--installdbuser 用于安装的用户 (root)
--lang 使用的语言 (en)
--pass 维基管理员的密码
--passfile 提供PASS选项的另一种方式,因为此文件的内容
--scriptpath Wiki在Web服务器中的相对路径 (/wiki)
--skins 要安装的外观的逗号分隔列表 (默认:全部)
--with-extensions 检测并包含扩展
--with-developmentsettings Load DevelopmentSettings.php in LocalSettings.php (Since MW 1.42 Gerrit change 977136)


参数

<name> 该维基的名称
<admin> 维基管理员的用户名


示例

使用在数据库中具有所需权限的用户设置Wiki,以便为该Wiki创建新数据库,并使用该用户操作该Wiki:

php maintenance/install.php --dbname=wikidb --dbserver="localhost" --installdbuser=root --installdbpass=rootpassword --dbuser=dbusername --dbpass=dbuserpassword --server="http://wiki.domain.name/" --scriptpath=/w --lang=en --pass=Adminpassword "Wiki Name" "Admin"