查看“FAQ:MediaWiki”的源代码
←
FAQ:MediaWiki
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[category:MediaWiki]] <span style="font-weight:bold; font-size:150%;"> [https://www.mediawiki.org/wiki/Manual:FAQ/zh 官网FAQ] </span> == 无法生成avg缩略图 == '''如果要使用第三方的converter,参见[https://www.mediawiki.org/wiki/Manual:Installing_third-party_tools#Image_thumbnailing Image thumbnailing页面]''' * '''描述:''' 上传'''<code>.svg</code>'''文件过后,页面中提示“生成缩略图出错:无法创建临时缩略图文件”,在“特殊页面:文件列表”中查看文件时: '''<code>Warning: symlink() has been disabled for security reasons in /www/wwwroot/wiki.eijux.com/includes/media/SvgHandler.php on line 280</code>'''。 *'''处理:''' 默认安装的PHP一些函数是没有默认开启的。 我们需要的函数是'''<code>symlink()</code>''',则用在PHP的禁用函数中删除该函数即可。 ---- * '''描述:''' 生成缩略图处提示:'''<code>sh: convert: command not found</code>''',PHP错误信息为'''<code>Warning: is_executable(): open_basedir restriction in effect. File(/bin/bash) is not within the allowed path(s): (/www/wwwroot/wiki.eijux.com/:/tmp/) in /www/wwwroot/wiki.eijux.com/includes/shell/Command.php on line 311</code>'''。 * '''处理:''' 先考虑是PHP配置的问题, <pre> PHP错误'''require(): open_basedir restriction in effect”''',即访问脚本不在'''<code>open_basedir</code>'''的限定目录里面,'''<code>open_basedir</code>'''的作用是将php所能打开的文件限制在指定的目录或文件。<br/> </pre> 修改PHP配置文件<code>PHP.ini</code>的<code>open_basedir</code>之后错误依旧,而后一直都盯着<code>open_basedir</code>打转。兜兜转转许久才注意到<code>sh: convert: command not found</code>的提示,想到可能没有配置Svg Converter,从而进一步发现MediaWiki没有默认安装Converter。最后在[https://www.mediawiki.org/wiki/Manual:Image_administration/zh#SVG | 官网手册SVG节]了解到支持信息,相关的Converter("ImageMagick", "ImagickExt", "sodipodi", "inkscape", "batik", "rsvg", and "imgserv")均需单独安装。相较之下,选用了[https://www.mediawiki.org/wiki/Extension:NativeSvgHandler/zh | NativeSvgHandler]扩展(将SVG文件直接发送至客户端以进行客户端渲染)。步骤如下:<br/> # '''下载文件,并将其放置在extensions/文件夹中的NativeSvgHandler目录内。(注意修改所有者及读写权限)''' # '''将下列代码放置在您的LocalSettings.php的底部:'''<code>wfLoadExtension( 'NativeSvgHandler' );</code>'''''' # '''导航至Special:Version,以验证扩展已成功安装。''' 再于网页刷新,svg缩略图显示正常。 * 如果要使用第三方的converter,参见[https://www.mediawiki.org/wiki/Manual:Installing_third-party_tools#Image_thumbnailing<nowiki> Image thumbnailing页面]</nowiki> <div style="background-color:#ffffcc; font-weight:bold;"> <s> == open_basedir restriction in effect == * '''描述:''' 错误信息为'''<code>Warning: is_executable(): open_basedir restriction in effect. File(/bin/bash) is not within the allowed path(s): (/www/wwwroot/wiki.eijux.com/:/tmp/) in /www/wwwroot/wiki.eijux.com/includes/shell/Command.php on line 311</code>'''。 * '''处理:''' PHP错误'''require(): open_basedir restriction in effect”''',即访问脚本不在'''<code>open_basedir</code>'''的限定目录里面,'''<code>open_basedir</code>'''的作用是将php所能打开的文件限制在指定的目录或文件。<br/> 查阅PHP配置文件'''<code>php.ini</code>'''搜索'''<code>open_basedir</code>'''如下: <pre> ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. ; Note: disables the realpath cache ; http://php.net/open-basedir ;open_basedir = </pre> 可知,当前未配置'''<code>open_basedir </code>''',添加配置如下: <pre> open_basedir = /www/wwwroot/wiki.eijux.com/:/tmp/ </pre> * '''注意''' 注意用'''<code>open_basedir </code>'''指定的限制'''是路径前缀,而非目录名'''。所以如果要将访问限制在仅为指定的目录,应用斜线结束路径名。<br/> 如:若'''"open_basedir = /dir/user"''', 那么目录 '''"/dir/user"''' 和 '''"/dir/user1"'''都是可以访问的。 <div style="color:red; font-weight:bold;"> 结果还是不好使<br/> 因为没有安装任何的svg渲染相关的扩展("ImageMagick", "ImagickExt", "sodipodi", "inkscape", "batik", "rsvg", and "imgserv".) </div> </s> </div> <!-- * '''描述:''' * '''处理:''' --> <!-- '''<code> </code>''' -->
返回至“
FAQ:MediaWiki
”。
导航菜单
个人工具
登录
命名空间
页面
讨论
大陆简体
已展开
已折叠
查看
阅读
查看源代码
查看历史
更多
已展开
已折叠
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
笔记
服务器
数据库
后端
前端
工具
《To do list》
日常
阅读
电影
摄影
其他
Software
Windows
WIKIOE
所有分类
所有页面
侧边栏
站点日志
工具
链入页面
相关更改
特殊页面
页面信息