The mbstring extension is missing. Please check your PHP configuration

PHP use Mbstring (multi-byte string) extension to convert strings to a different encoding. It is used to express more than 256 characters in a regular byte. Sometimes you will get a Mbstring extension missing error. In this tutorial, we will check how to fix this issue.

CONTENTS

How do I fix mbstring extension is missing?

We can fix it in different ways. So let’s check which method will solve your mbstring extension missing problem.

Also Read: Check if a string contains a specific word in PHP?

Method 1 – Changing PHP version:

  1. First upgrade or downgrade your PHP version.
  2. Restart apache server.

Method 2 – Installing mbstring extension on Linux:

If you are using Linux and PHP version 7.3 or any, follow the below steps-

  1. Open the terminal.
  2. Run sudo apt-get install php7.3-mbstring
  3. Restart the Apache server sudo service apache2 restart

Method 3 – Installing mbstring extension on Windows:

If you are a Windows user and using WAMP OR XAMPP, you have to find PHP installation location. As I am using WAMP, so the location is “C:\wamp64\bin\php\php7.3.5”. Here php7.3.5 is my current version. For XAMPP go to its installation location and find the PHP folder.

Also Read: How to target a specific city to show your website in PHP?

But if you are not using WAMP or XAMPP then go to “C:\php”. After that follow the below steps-

  1. After got to PHP directory, find php.ini and open it.
  2. Search for “extension_dir” and check if it is uncommented i.e. no semicolon(;) in front of “extension_dir“. If it is present, remove the semicolon.
  3. Then set the “ext” directory location as its value. Check the image below.
  4. As I am using PHP 7.3 so the “ext” directory location is “C:\wamp64\bin\php\php7.3.5\ext”
  5. Change extension_dir = “ext” into extension_dir = “C:\wamp64\bin\php\php7.3.5\ext” (write your own path depending on your PHP location)
  6. Now search for this ;extension=mbstring and remove ; from that line i.e extension=mbstring
  7. Save your php.ini and restart.

About Ashis Biswas

A web developer who has a love for creativity and enjoys experimenting with the various techniques in both web designing and web development. If you would like to be kept up to date with his post, you can follow him.

Leave a Comment