Configure MBString using UTF-8

This is the first post of 2013, so I will hope you all have a Great Year!

And the first success obtained in this year is the resolution of a problem that is strugling me since few days.

I have migrated an old VPS on a new (and clean) one, using the WHM wizard. Nothing was so simple… Apparently all works fine. But taking a look to some web sites installed on it, they was telling me that something was wrong… They were expecting for the MBString extension.

Just from VPS i went in the Apache installation wizard and I’ve activated the MBString extension. Simple… too much! Indeed it not was so simple… or it was… but don’t fall in the mouse trap: “the complusive mouse click syndrome” :-)

The default settings (at least for the Godaddy’s VPS) for mbstring uses a Japan language so, if your site uses UTF-8 as default encoding you will keep all the previous saved data… but the future inserts into the database will be break from the wrong encoding.

So don’t trust in the ones that tell that the problem is in Mysql 5.5 (maybe it’s right in China… not in Europe… at least not in Italy) neither trust in the chanche that using AddDefaultCharset uft-8 to your Apache configuration will solve your problems.

The only things to do is to set the following settings as reported in the PHP configuration editor (through your WHM console):

mbstring.http_input UTF-8
mbstring.http_output UTF-8
mbstring.internal_encoding UTF-8
mbstring.language Neutral
mbstring.substitute_character none

And all back to work fine!!!

Have a great 2013!

Commenti

Una risposta a “Configure MBString using UTF-8”

  1. Avatar Gabriele Romanato

    Thanks for the tip. Shared! Have an happy new year! :-)

%d blogger hanno fatto clic su Mi Piace per questo: