I need this php extension in order to use one of my Magento extension. How do I install php mbstring extension to my Nginx Ubuntu 14.04?
Asked
Active
Viewed 4.0k times
2 Answers
35
STEP 1 - Installing mbstring
PHP mbstring extension is not enabled by default as stated in PHP docs. Try these:
PHP 5:
sudo apt-get install php5-mbstring
PHP 7:
sudo apt-get install php7.0-mbstring
Now you should see mbstring as enabled in a file with below code (check above FelixEve's answer):
<?php echo phpinfo(); ?>
You might need to use the right extension name for your PHP version:
For example:
- for PHP 5.6:
sudo apt-get install php5.6-mbstring
- for PHP 7.1:
sudo apt-get install php7.1-mbstring
STEP 2 - Restart you server:
After the installation of mbstring
, you may need to restart your server (apache2
/ nginx
etc). Just use the following command.
sudo service apache2 restart
or
sudo service nginx restart

Community
- 1
- 1

Ajeet Shah
- 18,551
- 8
- 57
- 87
-
3For a PHP 5.6 installation I had to use `sudo apt-get install php5.6-mbstring`. – h2ooooooo Aug 06 '16 at 11:08
5
EDIT: See Ajeets answer below for the correct solution
I don't think mbstring (like OpenSSL) depends on an extension, it should just be built into PHP. I'm running Raspbian and NginX and if I create a file with
<?php phpinfo() ?>
and look at it then I see:
-
I see the same thing here..I was confused when extension author told me to install mbstring separately in order to use his extension.I guess its already built in.Thank you for your help. – n01 Mar 02 '15 at 10:06
-
2
-
1I've just found out how can I enable it. I use docker for php, so I added `docker-php-ext-install mbstring` and rebuilt the container. – starikovs Jan 29 '16 at 08:15