Lots of bloggers and site owners find themselves in the need to enable PHP Mbstring extension when they move to a new hosting server. That’s a problem that the hosting company should solve from the beginning, and even, before launching their services for WordPress, especially.
WordPress works with the mbstring PHP extension for Geolocation and other features. In the majority of the cases, you get an error message that clarifies the missing extension that you have to install. For example, you get this long error message saying:
“Geo Targeting has encountered an error, Please contact your web master. ERROR DETAILS : Please enable PHP mbstring extension on your server.“
The error message will exactly look like the following screenshot.
How to enable the PHP Mbstring extension?
Luckily, the majority of modern web hosting providers with cPanel let you manually enable that extension, and let your site works properly. All you have to do is to login into your cPanel account, then find the icon “Select PHP version”, “PHP Configuration”, or “PHP Settings”.
The name of the option depends on your hosting server configuration, but the main idea is to find the “PHP version settings” as the next screenshot.
Now, you will get the PHP extension that you can add with just a checkbox option, finally, save the changes. Please don’t go all the way with these extensions, you only need a few of them.
The other will not work with your WordPress or any other platform. They can break your site and disable other functions and even cause more problems. What you need in this case, is only the “mbstring” and you will find it on that page as it’s shown in the following screenshot example.
Please note that the extension placement is not the same in all the server settings. It depends on the number of settings and the added extension. Just search for it using the “Ctrl+F” keys on your Windows computer keyboard, or use “cmd+F” if you can find the exact nomination.
The above option is not available in all the cPanel hosting accounts, unfortunately. So, the hosting company administrator can enable, or disable, that option for customers. I hope that you have access to that option to solve the mbstring PHP extension problem on your website.
If you’re not familiar with any PHP settings, make sure to avoid adding, or executing any script or function in your cPanel account. That can make things complicated, and you can add more problems, instead of solving them.
You can find lots of tutorials, on how to add the mbstring manually, by executing a code, in your VPS, or whatever hosting server. But, make sure to ask professionals about these functions. Some of them can be special hacking tools and you should be careful there.
What if there no PHP Mbstring extension on the server?
Not all the web hosting providers work the same, some web hosts offer cPanel with the old version of PHP. While others configure their servers and add the latest PHP version but not letting users configure or check the option.
If you can’t find any way to configure your PHP settings, then, you need to contact your web hosting technical support, and they will set up the function for you. Let them know that your website needs the PHP Mbstring Extension to work, they’ll install it for you as there is no reason why they wouldn’t do such an easy task.
If you’re still unable to add the PHP Mbstring as an extension, then, your web host may not already have a good version of PHP and they don’t want to do that anyway. In this case, I recommend to choose a professional web hosting provider that has all the PHP extensions Like HostGator, you don’t have to ask for that, just log in to Panel, click the PHP configuration tool, and check the PHP Mbstring and everything will work smoothly.