Unicode library	Error
Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_input setting. Please refer to the PHP mbstring documentation for more information.

I am getting this error which prevents install on localhost.
My system is Linux 3.16-2-amd64 #1 SMP Debian 3.16.3-2 (2014-09-20) x86_64
PHP Version 5.6.0-1
Defensive comment: I am on the testing branch because I cannot use Debian stable as its kernel is too old for my advanced computer, and anyway testing branch is close to code freeze and release, so this is a non-issue.
Please read this: http://php.net/manual/en/mbstring.configuration.php
I am aware of this, my php.ini is set to default_charset = "UTF-8" and all the deprecated strings are empty and commented out.
I already installed patch in https://www.drupal.org/node/87138, my .htaccess has the two lines to no avail.
At this point, I don't know what else to do except ask Drupal to patch the next 7.x version to solve this problem

Comments

akael’s picture

You need to edit your php.ini setting to ensure the follow 2 items are set like this:

mbstring.http_input = pass
mbstring.http_output = pass

You might also need this one, but not sure:

mbstring.internal_encoding = pass

ckosloff’s picture

Added lines to php.ini to no avail, please note that they were already added to .htaccess.
mbstring.internal_encoding is deprecated in PHP 5.6, it only uses default_charset = "UTF-8", which is already set.
Fixes that used to work in previous versions no longer work, I have been through them, that is why I am asking core devs to patch the next 7.x version, there is nothing I can do in php.ini or .htaccess.

ckosloff’s picture

Sorry, it worked after restarting apache service.
I still think that this is a work-around that should not be there, and that future versions of Drupal should be patched.
EDIT: spoke too soon, although error disappeared Drupal cannot install, blank screen, database full but still returns to database details page.
I have to research this issue more in depth, but am confirming my suspicions that the two lines just cloak the error, without fixing it.
I don't want anybody to think that the addition of those two lines are a fix.

akael’s picture

ckosloff,

It works for me to install, are you getting any errors or log file entries?

ckosloff’s picture

do you have php 5.6.x?
Drupal installs but with errors, it does not log me in as uid with admin privileges.
If entering correct credentials it returns me to same login screen, with blank username and pass.
If incorrect credentials entered, it throws errors.
The apache error log does not have anything significant.
The .htaccess is now the one that Drupal ships, I spawned an entirely different instance, with different db.

delphiman2’s picture

I am having the same issue. Please help

ckosloff’s picture

I was hoping that 7.32 would address this but it does not.
I am checking apache config and it reports syntax OK, full status no problem.
I cannot use git locally and this is big problem.

ckosloff’s picture

Drupal installs with errors.
Unable to get the admin interface for user1, changing pass with drush will not help.
drush updb throws error:
"Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_input [warning]
setting. Please refer to the PHP mbstring documentation for more information. (Currently using Unicode library
Error)"
In spite of the lines above added to php.ini, I no longer see errors in install process, yet drush detects them.
Any Drupal core maintainers listening to this?
HELLO!!!!!
I tried installing a different PHP CMS in my localhost and it installed OK

ckosloff’s picture

There are two different problems here:
1) The multibyte string input conversion issue has not been fixed, to add lines to php.ini is not a solution, drush reports warnings that this is still active in system although installer does not show error any more.
In other words, error is still lurking in there, but concealed.
In fact, PHP 5.6 is better than previous versions, because all that installer reports about php.ini has been deprecated in favour of UTF 8, which is the default, so nothing should be altered there for this purpose, the bug is inside Drupal not in PHP, other PHP CMS do not report this bug.
2) The other bug is unable to login after install in localhost, this is related to the way Drupal installs cookies.
This bug has been plaguing Drupal since at least 2010 and several work-arounds have been offered:
https://www.drupal.org/node/1027534
However, work-arounds are not solutions, the bug is still there, and nobody in the Drupal website offered advice.
I use Debian, and in desperation, installed the Debian Drupal7 package, found same bug, took to the Debian IRC channels, found a user who reproduced bug, filed a bug report in Debian, and there, unlike in Drupal, found a response.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766008
This is related to a cookie Drupal installs in the browser that generated the site in localhost.
Please read complete solution in above link.
In Iceweasel.
Preferences -> Privacy -> remove individual cookies -> search for 'localhost' -> remove top cookie and test by restarting browser.
Your mileage may vary, you may need to remove more cookies in there (there are several), or look for your domain server, which may not be 'localhost'.
This is a work-around, not a solution, the bug is still there.
Other PHP CMS do not report this cookie issue.

twod’s picture

Status: Patch (to be ported) » Closed (duplicate)
Issue tags: -PHP, -localhost, -installation
Related issues: +#2332295: Unicode requirements check not working with PHP 5.6
  1. The issue status is wrong since there is no patch to port in here.
  2. The original poster mentions PHP 5.6, which has deprecated the mbstring.http_* settings, so the #2 fix won't work (also, they're already set by .htaccess if you're using mod_php for Apache).
  3. Setting default_charset "should" fix the issue, though "UTF_8" is already its default value so setting it explicitly won't work.
  4. There is a know issue with Drupal incorrectly showing this warning under PHP 5.6., and a core patch exists.
  5. Apply the patch in the referenced issue and you'll be fine under PHP 5.6. :)

ckosloff’s picture

"There is a know issue with Drupal incorrectly showing this warning under PHP 5.6., and a core patch exists."
Could not agree more, PHP 5.6 solves this problem, and therefore is better than previous versions, there is nothing to modify in php.ini.
I need instructions to apply this core patch, or should I wait for next version?
Thank you.

ckosloff’s picture

From php.net
default_charset string
In PHP 5.6 onwards, "UTF-8" is the default value and its value is used as the default character encoding for htmlentities(), html_entity_decode() and htmlspecialchars() if the encoding parameter is omitted. The value of default_charset will also be used to set the default character set for iconv functions if the iconv.input_encoding, iconv.output_encoding and iconv.internal_encoding configuration options are unset, and for mbstring functions if the mbstring.http_input mbstring.http_output mbstring.internal_encoding configuration option is unset.

So there should be no need for any manipulation of php.ini as of PHP 5.6.+, and in fact none is recommended.
I have successfully installed D7.32 in my localhost, however in my virtualbox, which has the same version, and replicates for the most part settings in my physical machine, I am still seeing that error, so far unable to understand why.

ckosloff’s picture

VICTORY! My vbox has Debian Linux testing branch with PHP version 5.6.2-1.
No modifications to php.ini, Drupal 7.33 installed without a glitch.
Apparently core devs finally listened.
So much for the schmucks saying that PHP 5.6 does not work with D7.
One more caveat: create a user with all priviliges on the db, apart from root, and never put an exclam (!) in the pass, Drupal misinterprets this.

Yonat’s picture

I got this same error message when I tried updating (update.php) my drupal site. Apparently, the message seems to invoke PHP issue with my server. I only got this problem when I upgraded my Debian 7 (Wheezy) to Debian 8 (Jessie). Respectively, apache2.2 was also upgraded to apache2.4. The upgrade renders my sites in my localhost/virtualhosts inaccessible. These links discuss issues regarding the upgrades-

https://www.debian.org/releases/jessie/amd64/release-notes/ch-informatio...


https://www.linode.com/docs/security/upgrading/updating-virtual-host-set...

After following the guides mentioned in said links, I got my localhost / virtualhosts working but only the homepages are accessible. Sites' links are not. I found that the 'access control directives' in v. 2.4 have changed considerably and will need manual migration to the new directives (as the guides in the links above mentioned).

Here is the solution:
Edit /etc/apache2/apache2.conf (new v.2.4 configuration, copy apache2.conf.dpkg-dist)
Change the default security model:
AllowOveride None
to
AllowOveride All

Why? the default setting prevents localhost from accessing .htaccess in the site's local directory. The .htaccess file contains directives for the PHP. This I think is where the trouble begins.

After implementing the above procedures, my drupal update (running update.php) was successful without said error message. I hope you will do as well in your drupal installation (install.php).

carvingpixel’s picture

Having issues installing D7 on win/iis and PHP 5.62, I downgraded to D6, got it past the 500 internal server error and got this new error. I tried the changes to php.ini, restarted services, and it did work.

However, I am wondering about this as well. I too read "In PHP 5.6 onwards, "UTF-8" is the default value and its value is used as the default character encoding.

srikanth.g’s picture

After changing these mbstring settings only, i am able to install the distributions openacademy and openenterprise in my php7(Bitnami xampp), Thanks.
mbstring.http_input = pass
mbstring.http_output = pass

ddarras2012’s picture

Try jsimonis' solution with ini_set: https://www.drupal.org/node/129223#comment-220608

Elifas’s picture

If you are on a shrared host and dont have access.. trying using PHP 5.5 casue my error went away wnet i down graded from PHP5.6 to a lower version.

jorgemontoyab’s picture

I'm working with Ubuntu 16.04 / php 7.0 and changed the file /usr/share/php7.0-mbstring/mbstring/mbstring.ini by adding these two lines:

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

and it worked after restrating the server. However I'm just playing around in my localhost, so I don't know if that's the most accurate solution for this issue in a production server.

srikanth vamaraju 1993’s picture

I am facing the same issue when i am trying to upload the files to my server,
My server version is" Linux 4.4.0-38-generic x86_64"
I have PHP 7

edited my php.ini settings page with these two lines
mbstring.http_input = pass
mbstring.http_output = pass

and also tried with

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

But adding these did help me fix the issue.
please help me out if you have any other solution for this.

dewancodes’s picture

I tried following code in settings.php and it worked like a charm :)

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

Surya1988’s picture

thanks dewanhkf it worked for me

but it pops up the following message during drupal installation:

Deprecated function: ini_set(): Use of mbstring.http_input is deprecated in include_once() (line 291 of /var/www/html/sites/default/settings.php).
Deprecated function: ini_set(): Use of mbstring.http_output is deprecated in include_once() (line 292 of /var/www/html/sites/default/settings.php).

erykolryko’s picture

mine also pops up the message

ressa’s picture

I can confirm that this was fixed somewhere between 7.32 and 7.35, having just downloaded one after the other, and tried installing them on a Scotch Box. 7.32 gave me the error, whereas 7.35 installed with no problems.

omrmankar’s picture

Thanks

soniaojha’s picture

#1 worked for me.

epruett’s picture

#1 worked for me.

theodor.kurz’s picture

I found a solution to this problem. The code where the check is performed:

\xampp\htdocs\drupal-7.12\unicode.inc:

Lines 107,ff
// Check mbstring configuration
if (ini_get('mbstring.func_overload') != 0) {
return array(UNICODE_ERROR, $t('Multibyte string function overloading in PHP is active and must be disabled. Check the php.ini mbstring.func_overload setting. Please refer to the PHP mbstring documentation for more information.', array('@url' => 'http://www.php.net/mbstring')));
}
if (ini_get('mbstring.encoding_translation') != 0) {
return array(UNICODE_ERROR, $t('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.', array('@url' => 'http://www.php.net/mbstring')));
}
if (ini_get('mbstring.http_input') != 'pass') {
return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_input setting. Please refer to the PHP mbstring documentation for more information.', array('@url' => 'http://www.php.net/mbstring')));
}
if (ini_get('mbstring.http_output') != 'pass') {
return array(UNICODE_ERROR, $t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_output setting. Please refer to the PHP mbstring documentation for more information.', array('@url' => 'http://www.php.net/mbstring')));
}

The code inserted is that matches with the above requirements:

\xampp\php\php.ini

Line 1658
mbstring.http_input = 'pass'

Line 1671
mbstring.http_output = 'pass'

Notice the apostrophs after the equal sign.