You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu20.04+Docker-Compose环境下MediaWiki1.38的VisualEditor配置问题

MediaWiki 1.38 VisualEditor 无法连接Parsoid/RESTBase问题

环境信息

本地通过docker-compose运行MediaWiki 1.38.2实例,所有容器运行正常,docker-compose配置如下:

version: '3.7'
services:
  mediawiki:
    image: myImageMediawiki:1.38.2
    restart: always
    ports:
      - 8090:80
    links:
      - database
      - memcached
    volumes:
      - /home/path/mediawiki/volumes/extensions/PluggableAuth:/var/www/html/extensions/PluggableAuth
      - /home/path/mediawiki/volumes/extensions/LDAPAuthentication2:/var/www/html/extensions/LDAPAuthentication2
      - /home/path/mediawiki/volumes/extensions/LDAPProvider:/var/www/html/extensions/LDAPProvider
      - /home/path/mediawiki/volumes/extensions/LDAPAuthorization:/var/www/html/extensions/LDAPAuthorization
      - /home/path/mediawiki/volumes/extensions/Babel:/var/www/html/extensions/Babel
      - /home/path/mediawiki/volumes/extensions/VisualEditor:/var/www/html/extensions/VisualEditor
      - /home/path/mediawiki/volumes/images:/var/www/html/images
      - /home/path/mediawiki/volumes/LocalSettings.php:/var/www/html/LocalSettings.php
      - /home/path/mediawiki/volumes/ldapprovider.json:/var/www/html/ldapprovider.json
      - /home/path/mediawiki/volumes/php.ini:/usr/local/etc/php/php.ini
      - /home/path/mediawiki/volumes/logo/logo.png:/var/www/html/resources/assets/logo.png
  memcached:
    image: memcached:1.6-alpine
    restart: always
  database:
    image: mariadb:10.5
    restart: always
    volumes:
      - /home/path/mediawiki/volumes/db:/var/lib/mysql
      - /home/path/mediawiki/volumes/initdb:/docker-entrypoint-initdb.d
    environment:
      MYSQL_DATABASE: myDB
      MYSQL_USER: user
      MYSQL_PASSWORD: password
      MYSQL_RANDOM_ROOT_PASSWORD: 'yes'

VisualEditor安装配置

已下载1.38版本的VisualEditor扩展,放置到指定扩展目录(操作方式与其他扩展一致),并在LocalSettings.php中添加以下配置:

wfLoadExtension( 'VisualEditor' );

$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
$wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
$wgGroupPermissions['user']['writeapi'] = true;

问题现象

  • VisualEditor按钮正常显示,但点击「修改」按钮时触发错误
  • 访问http://localhost:8091/api.php可正常加载,但调用VisualEditor编辑页面端点时,返回如下错误响应:
{
  "error": {
    "code": "apierror-visualeditor-docserver-http-error",
    "info": "Error contacting the Parsoid/RESTBase server: (curl error: 7) Couldn't connect to server",
    "docref": "See http://localhost:8091/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
  }
}

内容的提问来源于stack exchange,提问作者Dyn amo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 17:47:13