1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Webmin 1.791でエラー「Wide character in syswrite at /usr/libexec/webmin/miniserv.pl line 3071.」を回避

Posted at

webminのトップページを開くと、HTMLの出力途中でエラーが発生し
後続の表示がされなくなってしまった。

トップページのエラー表示
    HTTP/1.0 500 Perl execution failed
Server: MiniServ/1.791
Date: Thu, 16 Jun 2016 10:41:17 GMT
Content-type: text/html; Charset=iso-8859-1
Connection: close

<h1>Error - Perl execution failed</h1>
<pre>Wide character in syswrite at /usr/libexec/webmin/miniserv.pl line 3071.
</pre>

該当箇所にエンコード処理を追加する事でとりあえず回避できた。

ファイルの最初の方でEncodeの使用を宣言しておいて、

miniserve.pl
use Encode;

syswriteする箇所を、utf8の場合のみエンコードする様に修正。

miniserve.pl
    if(utf8::is_utf8($str)) {
        syswrite(SOCK, encode('utf-8', $str), length(encode('utf-8', $str)));
    } else {
        syswrite(SOCK, $str, length($str));
    }

修正後にwebminを再起動して反映。

再起動
/etc/init.d/webmin restart

これでとりあえず動くようになった。

環境は
CentOS Linux 7.2.1511
Webmin 1.791

より新しいバージョンで直っているかどうかは未確認。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?