douya5194 2016-01-31 03:19
浏览 71

Mediawiki:oojs-ui.styles.icons模块导致500服务器错误

I installed VisualEditor for Mediawiki and configured it correctly, so that the editing mode worked fine. But after upgrading to a newer Mediawiki version, VisualEditor doesn't work anymore.

Once I checked my DOM console I noticed, that the issue is caused by a module called oojs-ui.styles.icons creating a 500 server error. I also took a look into my error.log file. These are the essential details:

2016/01/31 03:33:47 [error] 1178#0: *50446 FastCGI sent in stderr: "PHP message: PHP Warning:  DOMDocument::load(): I/O warning : failed to load external entity "/var/www/html/Wiki/resources/lib/oojs-ui/themes/mediawiki/images/icons/add.svg" in /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php on line 275
PHP message: PHP Notice:  Trying to get property of non-object in /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php on line 278
PHP message: PHP Fatal error:  Call to a member function appendChild() on a non-object in /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php on line 281" while reading response header from upstream, client: 123.123.123.123, server: domain.com, request: "GET /load.php?debug=true&modules=oojs-ui.styles.icons&* HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "domain.com"

Obviously the filepath can't be recognized, because of the " attribute. So I checked line 275 of the file /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php, which contains the following:

protected function variantize( $variantConf, ResourceLoaderContext $context ) {
    $dom = new DomDocument;
    $dom->load( $this->getPath( $context ) ); ########## Line 275
    $root = $dom->documentElement;
    $wrapper = $dom->createElement( 'g' );
    while ( $root->firstChild ) {
        $wrapper->appendChild( $root->firstChild );
    }
    $root->appendChild( $wrapper );
    $wrapper->setAttribute( 'fill', $variantConf['color'] );
    return $dom->saveXml();
}

Normally, the php function getPath() should work fine, shouldn't it? I am wondering why this is not working. I updated every extension afterwards but still no changes.

What do I have to do, in order to fix the error message from the error.log file?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)