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.
| Comment | File | Size | Author |
|---|---|---|---|
| Capture of the error.png | 59.5 KB | carrotandme |
Comments
Comment #2
carrotandme commentedComment #3
carrotandme commentedComment #4
cilefen commentedThis 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.
Comment #5
carrotandme commented@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.
Comment #6
cilefen commentedThat’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.
Comment #7
cilefen commentedThis is precisely the code that checks: https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/lib/Drupal/...
Comment #8
quietone commentedTrimming the title and moved the error msg to the IS.
Comment #9
cilefen commentedComment #10
carrotandme commentedThanks 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.
Comment #11
s427 commentedSubscribing because I'm seeing the same error (on the admin/reports/status page) after switching from PHP 7.4 to PHP 8.1.14, with Drupal 9.5.4.
On the phpinfo page (accessed from the Drupal status page), the value for
mbstring.encoding_translationis Off (local) and Off (master).Is it safe to operate Drupal (e.g. create or edit nodes) while this error is showing?
Comment #12
s427 commentedUpdate: 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.
Comment #13
cilefen commentedAccording to the docs in https://www.php.net/manual/en/configuration.file.php,
Are the quotation marks the problem?
Comment #14
bushrang3r commentedOP'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 =
Off0Comment #15
cilefen commentedI am closing this as there have been no replies. Reopen it if needed.