简体   繁体   English

安装Mediawiki后的空白页面

[英]Blank page after installing Mediawiki

I installed Mediawiki by uploading the files to "/wiki" directory then I opened "/wiki/mw-config/index.php" and made the configuration and uploaded the "LocalSettings.php" to "/wiki" 我通过将文件上传到“/ wiki”目录安装了Mediawiki,然后我打开了“/wiki/mw-config/index.php”并进行了配置并将“LocalSettings.php”上传到“/ wiki”

when I try to open the wiki using "/wiki/index.php", I see a blank page. 当我尝试使用“/wiki/index.php”打开维基时,我看到一个空白页面。

The problem was that the generated LocalSettings.php file has an extra html div tag. 问题是生成的LocalSettings.php文件有一个额外的html div标签。 I thing this is a bug in the Mediawiki. 我认为这是Mediawiki中的一个错误。 After I removed this tag, it worked 删除此标记后,它就可以了

From http://www.mediawiki.org/wiki/Blank_page#You_see_a_Blank_Page : 来自http://www.mediawiki.org/wiki/Blank_page#You_see_a_Blank_Page

A blank white page indicates a PHP error which isn't being printed to the screen. 空白页表示未在屏幕上打印的PHP错误。 To force this, add the following lines to the LocalSettings.php file, underneath the < ?php: error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); 要强制执行此操作,请将以下行添加到LocalSettings.php文件中<?php: error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); . You can also set a value for error_log in PHP.ini and read the PHP error log to find out what's going on. 您还可以在PHP.ini中为error_log设置一个值,并阅读PHP错误日志以了解正在发生的事情。 In some cases, PHP errors might also be recorded in the web server error log. 在某些情况下,PHP错误也可能会记录在Web服务器错误日志中。

In my case, I checked the server error log and found the following line: 在我的情况下,我检查了服务器错误日志,并找到以下行:

PHP Fatal error:  Class 'DOMDocument' not found in /path/includes/cache/LocalisationCache.php on line NNN, referer: http://wiki.example.com/

Which can be fixed by either installing the right php-xml package for your distro, or by changing the MediaWiki 'preprocessor' class in LocalSettings.php, as mentioned on the WikiMedia Manual 可以通过为您的发行版安装正确的php-xml包,或者通过更改LocalSettings.php中的MediaWiki'预处理器'类来修复 ,如WikiMedia手册中所述

I needed to install php-xml and restart httpd. 我需要安装php-xml并重启httpd。 It works great. 它很棒。

I also simply needed to install php-xml and restart httpd. 我还需要安装php-xml并重启httpd。

sudo yum install php-xml

sudo /sbin/service httpd restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM