Looking for ways to manage special text on your websites?

One of the best ways for this is to enable mbstring in php.ini.

Usually, mbstring extension in web servers helps to manage the non-ASCII codes easily.

At Bobcares, we often get requests to enable mbstring extension, as a part of our Server Management Services.

Today, let’s see how our Support Engineers enable the mbstring extension for our customers.


How does mbstring error look?

Let’s begin by checking more details on mbstring and how the error appears on any website.

By default, mbstring makes multibyte encoding possible in PHP. This PHP extension helps in managing non-ASCII string. A typical example would be a website that handles musical quotes. It helps to manipulate strings encoded in a multi-byte encoding.

In many situations, customers get an error message related to missing PHP extensions. This particularly happens after enabling PHP function for wrong version of PHP. Or when the website uses an alternate PHP version.

For instance, while trying to enter phpMyAdmin and the mbstring module is missing on the server, it results in an error:


phpMyAdmin error due to improper enabling of mbstring in php.ini

How we enable mbstring in php.ini?

Usually, adding the extension in the php.ini file enables mbstring. But, this procedure varies with different platforms.

With the expertise in Server Management, our Dedicated Engineers enable the mbsting module for our customers.

Let’s see the multiple ways that we use to enable mbstring on various platforms.


1. mbstring in Linux

Linux servers provide an easy way to enable PHP extensions.

Firstly, our Support Team check for the mbstring module using the command,

php -m | grep mbstring

If there is no such module, then we install it using the command,

yum install php7x-mbstring

Afterward, we make sure the presence of necessary extension in the PHP include file. A sample entry looks like:

[root@xxx ~]# cat /etc/php.d/mbstring.ini
; Enable mbstring extension module

Later we ensure to restart the webserver to save the changes. This enables PHP mbstring on the server. Finally, we verify the same by adding a web page that dispaly the results of the phpinfo() function.


2. In Windows

In the Windows server, the addition of the .dll files holds multiple codes and procedures. So, the Support Team first makes sure that the .dll file is present in the server.

Usually, php.ini is the file that contains all the PHP parameters. Thus, we access the php.ini file.

We check for the entry regarding the mbstring extension in the configuration file. We uncomment the line,

extension = php_mbstring.dll

Later, we save the changes and restart the webserver.


3. Enabling mbstring in cPanel

In servers having a cPanel, it is easier to enable mbstring. So, for cPanel customers we enable mbstring as follows:

  1. Firstly, we login to the cPanel account.
  2. Next, we go to the Software section.
  3. Here, we click the drop-down to Select the PHP version.
  4. Now, select the PHP extension mbstring.
  5. Finally, click the save button.


[Having difficulty in enabling PHP mbstring? – We will do it for you.]


In short, to manage non-ASCII strings, we enable mbstring in php.ini. Today, we saw how to enable mbstring on different server platforms. We also saw how our Support Engineers fix the mbstring error in phpMyAdmin.


Source link


Write A Comment