Manual:Config script/zh

'''翻译未完成，不要删除. The translation is not completed, don't delete it.''' 一旦你上传/安装Mediawiki在Web服务器上，你需要做的第一件事情是运行所提供的配置脚本完成基本设置. 该脚本可以把你需要的信息告诉Mediawiki，以启动和运行您的wiki.

打开Mediawiki的安装表格
在下面的例子中，假设您的网站是位于 而实际的位置在. 您将需要因应您的情况调整您的例子以使用合适的位置.


 * 1) 使用您的浏览器，浏览Wiki的首页. 这是安装Mediawiki的文件夹内的 ，通常是 (例如 假设你安装Mediawiki于 ).


 * 1) 你会看到先前安装的Mediawiki版本和一个链接写着「请首先设置您的wiki. 」点击链接开始运行配置脚本. 如果你想直接去那里，该档案是在wiki的 目录（因此使用上面的例子会去到 ).
 * 2) 如果脚本察觉有任何配置错误，那么它不会让你继续. 请参阅下面关于您可能看到的信息的详细信息，您可能会遇到的错误消息，以及该怎么做.
 * 3) 如果所有的测试都通过，您将填写Mediawiki现在需要的信息.
 * 1) 如果所有的测试都通过，您将填写Mediawiki现在需要的信息.

填写窗体字段
按照表格上的说明填写所需的项目(如果你不确定要输入什么，请参考下表)后，点击「安装Mediawiki!」按钮. 该脚本将填充数据库，并写入配置文件.

在安装脚本成功运行后，系统会在"config"目录中创建一个名为LocalSettings.php的档案. 这个文件包含了所有Mediawiki运行时所需要的信息. 由于它以纯文本储存了指定的数据库用户的密码，因此我们强烈建议您创建一个wiki特定的数据库账户(不是root). (请参阅下表中的数据库用户名)


 * 1) 将此文件移动到主要的Wiki目录(如果你安装Meidawiki到/home/example/web/w，移动到这).
 * 2) 在LocalSettings.php文件中设置严格的权限.
 * 3) * 设置chmod600和chown (所有者读写，没有其它的权限).
 * 4) 删除「config」(1.17版之前)或「mw-config」(1.17版之后)的目录.

一旦你完成了上述步骤，你的wiki应该是可以使用了. 浏览到你安装的地址(在我们的例子中是 http://www.example.com/w/index.php ，并开始编辑！

Installation errors
When you run the config script it makes various checks of your system, and tells you if there are any problems.
 * After installation if your server is redirecting to a non-existant url try and go back and hit stop before the page redirects and grab Localsettings.php.

Add the following line after $wgSitename:


 * Parse error: parse error, expecting `T_STRING' in [...]\wiki\includes\Namespace.php on line 52
 * Make sure you have the appropriate version of PHP for the version of MediaWiki you are installing.
 * Attempting to connect to database server as wikiuser...failed with error [2004] Can't create TCP/IP socket (10106).
 * Often found in the internet that you should turn on named pipes in the MySQL configuration, but this did not help me (this
 * appeared under Win2000 with MySQL 5.0)
 * "Warning: main [function.main]: open_basedir restriction in effect. File(/convertLinks.inc) is not within the allowed path(s):"
 * Apparently the include path sometimes needs to be set. Put [ php_value include_path '/var/www/vhosts/yourhost.com/httpdocs/pathtowiki'  ] in you .htaccess file.
 * (MediaWiki 1.10.1&1.11.2) After 'Running the script' 1. The text is: 'Setup has completed, your wiki is configured.' Selecting 'your wiki' opens a new screen with the address: http://localhost:8080/mediawiki/index.php and the error '404: The page cannot be found'.
 * Path to php5isapi.dll is incorrect. In IIS manager go to web sites right click on web site go to properties then go to home directory tab and then click on configure find php in the list and then click edit and fix the path (C:\progra~1\php\php5is~1) Should be ("C:\program files\php\php5isapi.dll")
 * Warning: getrusage is not supported in this PHP build
 * We do function_exists checks for getrusage, so if you see this error message, probably means you should file a bug.
 * Parse error: syntax error, unexpected T_LNUMBER, expecting ';' in .../wiki/includes/GlobalFunctions.php on line 75


 * Creating tables...Query "CREATE TABLE `user` ( user_id int" ..."You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=InnoDB' at line 20 (localhost)".
 * In the latest version of MySQL, TYPE= syntax has been changed to ENGINE=. Modify the entire tables.sql script.

Fatal error: Call to undefined method domdocument::loadXML in C:\xampp\htdocs\w\includes\Preprocessor_DOM.php on line 568
 * Warning: domdocument::domdocument expects at least 1 parameter, 0 given in C:\xampp\htdocs\w\includes\Preprocessor_DOM.php on line 566
 * Set  in LocalSettings.php.
 * Creating tables... using MySQL 4 table defs...Query "CREATE TABLE `v_job` ( job_id int(9) unsigned NOT NULL auto_increment, job_cmd varchar(255) NOT NULL default , job_namespace int NOT NULL, job_title varchar(255) binary NOT NULL, job_params blob NOT NULL default , PRIMARY KEY job_id (job_id), KEY (job_cmd, job_namespace, job_title) ) TYPE=InnoDB " failed with error code "Specified key was too long; max key length is 1024 bytes (h41mysql79.secureserver.net)


 * Warning: ini_set has been disabled for security reasons in .../includes/AutoLoader.php on line 5


 * Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web apps. Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later! ABORTING (http://bugs.php.net/bug.php?id=45996 for details).
 * Well as the error says, either upgrade one, or downgrade one.

[TODO: This section should list all potential error messages and how to fix them. Or perhaps they should be on a separate page (depends how many there are, I guess... --HappyDog 22:05, 29 August 2007 (UTC)]

Configuration errors
[TODO: This section should list all errors that can occur when submitting the form, and how to handle them. Or perhaps on a separate page, if necessary]

Warning: $wgSecretKey key is insecure, generated with mt_rand. Consider changing it manually.
 * What about the $wgSecretKey e.g.

a) what is this and b) what is the solution ?

Answer: It means your system doesn't support /dev/urandom so the key was generated with mt_rand. You can manually edit the wgProxyKey field in LocalSettings.php.


 * Specified key was too long
 * Answer

Advanced configuration

 * Manual:$wgEnableUploads to enable image/files upload.
 * Also see Manual:Short URL for having more user friendly url to article pages.
 * See Manual:Configuring MediaWiki for links to more advanced configuration.
 * See Manual:Wiki family to setup multiple instances of MediaWiki with single set of MediaWiki files.