update.php fails with Multibyte string input conversion in PHP is active and must be disabled.

Created on 19 February 2023, over 1 year ago
Updated 16 June 2023, about 1 year ago

Problem/Motivation

In mydomain.com/update.php, I tried to update the database, but it says "Multibyte string input conversion in PHP is active and must be disabled. Please refer to the PHP mbstring documentation for more information.

This is the full msg: Error: Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.encoding_translation setting. Please refer to the PHP mbstring documentation for more information.

Steps to reproduce

Reload mydomain.com/update.php as described above and an error will occur.

I have tried the following responses based on various, community posts, but the message persists.

- php.ini
Ensure that the settings are as follows

mbstring.http_input = pass
mbstring.http_output = pass
mbstring.encoding_translation = Off

- /public_html/sites/default/settings.php
Add the following code to the top of the file

ini_set('mbstring.http_input', 'pass');
ini_set('mbstring.http_output', 'pass');

- .htaccess
Add input and output code under "php_value assert.active 0" as follows.

<IfModule mod_php.c>
  php_value assert.active                   0
  php_value mbstring.http_input             pass                                
  php_value mbstring.http_output            pass                                
</IfModule>

It may be related to the fact that "mbstring.http_input" and "mbstring.http_output" are deprecated in php8, but I don't know how to solve it specifically.

Any advice would be appreciated.

πŸ’¬ Support request
Status

Closed: outdated

Version

9.5

Component
Database updateΒ  β†’

Last updated 9 days ago

No maintainer
Created by

πŸ‡―πŸ‡΅Japan carrotandme

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @carrotandme
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    This is a support request. What is the actual runtime value? You can find that on the as shown on this old article: https://www.drupal.org/node/59680 β†’

    I think it’s in the same place for Drupal 9.

  • πŸ‡―πŸ‡΅Japan carrotandme

    @cilefen
    Thank you for your response.
    I am sorry, but what exactly do you mean by "Runtime Value"?
    By the way, I was able to get the php information with phpinfo.

  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    That’s good. What are the runtime values? By β€œruntime” I mean the effective values in the web platform context, rather than in various configuration files.

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    Trimming the title and moved the error msg to the IS.

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen
  • πŸ‡―πŸ‡΅Japan carrotandme

    Thanks for the reply.
    I don't know if this answers your question, but I will list below the values of the properties that would be relevant.

    Multibyte Support	enabled
    HTTP input encoding translation	disabled
    Directive	Local Value	Master Value
    mbstring.detect_order	auto	auto
    mbstring.encoding_translation	Off	Off
    mbstring.http_input	pass	pass
    mbstring.http_output	pass	pass
    mbstring.http_output_conv_mimetypes	^(text/|application/xhtml\+xml)	^(text/|application/xhtml\+xml)
    mbstring.internal_encoding	UTF-8	UTF-8
    mbstring.language	Japanese	Japanese
    mbstring.regex_retry_limit	1000000	1000000
    mbstring.regex_stack_limit	100000	100000
    mbstring.strict_detection	Off	Off
    mbstring.substitute_character	no value	no value
  • πŸ‡¨πŸ‡­Switzerland s427

    Subscribing because I'm seeing the same error (on the admin/reports/status page) after switching from PHP 7.4 to PHP 8.1.14

    On the phpinfo page (accessed from the Drupal status page), the value for mbstring.encoding_translation is Off (local) and Off (master).

    Is it safe to operate Drupal (e.g. create or edit nodes) while this error is showing?

  • πŸ‡¨πŸ‡­Switzerland s427

    Update: my hosting provider uses a system with a ".user.ini" file to store user defined PHP settings.

    Originally, this file had the following line (among others):
    mbstring.encoding_translation = "off"

    If I replace "off" by "0" (zero) in that line, then the warning in Drupal goes away.

    I'm not sure which value is "more correct" ("off" or "0"), but perhaps the check in Drupal (link in comment #7) should be updated to test for "off" in addition to "0"? Since the phpinfo page shows "off", I'm guessing it's a valid value.

  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    According to the docs in https://www.php.net/manual/en/configuration.file.php,

    ; Boolean values can be set to either:
    ;    true, on, yes
    ; or false, off, no, none
    register_globals = off
    track_errors = yes
    

    Are the quotation marks the problem?

  • πŸ‡¦πŸ‡ΊAustralia bushrang3r

    OP's php.ini lines did the job for me.
    The server was set to "Off" and I was getting the same error until I added the php.ini lines with "0" instead of "Off". No more errors.

    mbstring.http_input = pass
    mbstring.http_output = pass
    mbstring.encoding_translation = 0

  • Status changed to Closed: outdated about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    I am closing this as there have been no replies. Reopen it if needed.

Production build 0.71.5 2024