Php Enable Mbstring



What is Mbstring?

Enable PHP Mbstring Extension on your Server directly from cPanel Last updated on February 16, 2020 by Fathi Arfaoui Lots of bloggers and site owners find themselves in the need to enable PHP Mbstring extension when they move to a new hosting server. As of PHP 7.4.0, pkg-config is used to detect the libonig library. Prior to PHP 7.4.0, Oniguruma was bundled with mbstring, but it was possible to build against an already installed libonig by passing -with-onig=DIR. It is possible to disable the multibyte regex backtrack check by specifying.

EnablePhp enable mbstring

The Mbstring is an extension of PHP and stands for multi-byte string functions. It is basically used to represent the non-ASCII strings. As there are many languages those can be represented by one to one mapping to an 8-bit value but also some languages those require more than 8-bit mapping, thus, they need the mbstring to encode multibyte characters and express more than 256 unique value or characters in the regular bytewise coding system. Mbstring is designed to handle Unicode-based encodings such as UTF-8 and UCS-2 and many single-byte encodings for convenience PHP Character Encoding Requirements.

Install mbstring ubuntu

If you are dealing with some web applications based on PHP that deals in the multibyte characters language then it will require the mbstring PHP extension. Here is the way to install or enable the mbstring PHP extension on a server with WHM/Cpanel.

How to enable mbstring PHP extension in WHM:

Step 1: Login to your WHM (web hosting management) installed on VPS or dedicated server.

Step 2: You need to log in it as root.

Php

Step 3: After successfully accessing the WHM, search the Software section from the left side options panel of the WHM.

Step 4: Under the Software, click on the EasyApache.

Step 5: On the top of the EasyApache4 you will find your current installed Cpanel profile that consists of all packages of Apache and PHP.

Php 7 Enable Mbstring Extension

Step 6: Click on the Customize button.

Php Enable Mbstring

Step 7: From the left side given options select the PHP extensions.

Step 8: Now in the search box type mbstring

Step 9: The system will search and show you the available mbstring extensions corresponding to the available PHP versions.

Step 10: If you want to enable mbstring for all available PHP version then simple toggle the button given in front of them. Or slide the toggle only to specific PHP version’s mbstring.

Step 11: After enabling the mbstring, click on the Review option given on the left side.

Step 12: Scroll down and click on the Provision button. As you click on this button the WHM will install the mbstring php extension for all Cpanel account created under that.

Enable Mbstring Php Ubuntu

How to enable mbstring PHP extension in Cpanel:

If you don’t want to enable the mbstring for all Cpanel accounts then the administrator or the user can directly login to its website’s Cpanel account to enable the mbstring PHP extension.

Here for tutorial purpose, we are using the Godaddy Cpanel of some shared hosting. However, the steps will be the same for other hosting services such as Bluehost, Kinsta, Hostgator and more.

  1. Go to your Hosting provider.
  2. Login to access your website Cpanel Dashboard.
  3. Scroll down to the Software section of the Cpanel.
  4. Click on the option “Select PHP version
  5. Now you will get a screen with all available PHP extensions. And on the top left side, you will see the drop down box to select the PHP version you want to enable for your website.
  6. Change the version, if you required otherwise leave it as it is.
  7. Now find the mbstring extension from the given extensions packages.
  8. When you found the mbstring, just check the box given in front of it in order to enable.
  9. After selecting the mbstring, click on the Save button given at the bottom.

The Mbstring Extension Is Missing

In this way, you can install or enable the mbstring PHP extension for your web applications from WHM or Cpanel.