【发布时间】:2020-10-19 20:37:19
【问题描述】:
我在 Amazon ec2 服务器上安装了 mediawiki。
服务器只有apache、php、mariadb和mediawiki
我使用的是 mediawiki 1.35,捆绑了 VisualEditor 和 ParsoidPHP
我可以使用可视化编辑器编辑新页面,但它不会保存,当我编辑现有页面时,我会看到蓝色进度条,然后出现错误:
联系 Parsoid/RESTBase 服务器时出错:( curl 错误:28) 已超时
我尝试使用我在网上找到的说明配置 parsoid:
$wgVirtualRestConfig['modules']['parsoid'] = [
// URL to the Parsoid instance - use port 8142 if you use the Debian package - the parameter 'URL' was first used but is now deprecated (string)
'url' => 'http://myIpAddress:8000',
// Parsoid "domain" (string, optional) - MediaWiki >= 1.26
'domain' => 'myIpAddress',
// Parsoid "prefix" (string, optional) - deprecated since MediaWiki 1.26, use 'domain'
'prefix' => 'myIpAddress',
// Forward cookies in the case of private wikis (string or false, optional)
'forwardCookies' => true,
// request timeout in seconds (integer or null, optional)
'timeout' => null,
// Parsoid HTTP proxy (string or null, optional)
'HTTPProxy' => null,
// whether to parse URL as if they were meant for RESTBase (boolean or null, optional)
'restbaseCompat' => null,
];
我得到的最佳效果是 404 或 400。此配置不起作用。
我没有对设置进行任何其他更改。
如果我直接调用 parsoid:
http://MyIpAddress/api.php?action=visualeditor&paction=parse&page=Main_Page
我因此看到了超时:
{
"error": {
"code": "apierror-visualeditor-docserver-http-error",
"info": "Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached",
"*": "See http://MyIpAddress/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
}
}
【问题讨论】:
-
如果你根本不碰
$wgVirtualRestConfig,它应该可以开箱即用。 -
我花了很多时间处理错误后才添加配置。无论是否存在,我都会收到错误消息。
-
Parsoid 模块的配置非空将导致错误(尽管通常我希望有一个不同的错误) - 请参阅this check。
标签: mediawiki