Topic on Project:Support desk

mb_convert_encoding() - api.php

5
Summary by Ciencia Al Poder
Chrisjx (talkcontribs)

I'm getting this error when I try to access the api page http://my.url/tw/api.php

Fatal error: Call to undefined function mb_convert_encoding() in /var/www/tw/includes/HtmlFormatter.php on line 66

I see notes about multibyte issues but it is not clear to me why I would need this feature; we have simple needs only in english... phpinfo indicates Zend Multibyte Support is disabled. This is a relatively new install with 2-3 year old content from an earlier version of wikipedia. Never tried to use the api function before.

Thanks for any tips,

Chris.

Chrisjx (talkcontribs)

I see the line 66 of HtmlFormatter.php:

$html = mb_convert_encoding( $this->html, 'HTML-ENTITIES', 'UTF-8' );

it's not clear why the api function would be calling a non-existent function if multibyte is optional.

from: https://www.mediawiki.org/wiki/PHP_configuration

Optional

MediaWiki either needs or wants a number of optional features of PHP that need to be enabled at compile time:

  • mbstring multibyte character string support (optional; slower custom code will be used if not available)

Does this mean I have to recompile PHP to use api? Yikes.

Chrisjx (talkcontribs)

Did not have subscription to yum repos for rhel. Downloaded the rpm, php-mbstring-5.3.3-46.el6_6.x86_64.rpm

ran:

yum install php-mbstring-5.3.3-46.el6_6.x86_64.rpm

seems to be working...

88.130.126.59 (talkcontribs)

In order to use the mb_convert_encoding() function, you must have the mbstring PHP extension activated.

Ciencia Al Poder (talkcontribs)
Reply to "mb_convert_encoding() - api.php"