0

I have using PHP 7.2 version,and modules list is given below:

php -m

[PHP Modules]

bz2
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
openssl
pcntl
pcre
PDO
Phar
Reflection
session
SimpleXML
soap
sodium
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

In this list it shows mbstring but in info.php on browser it doesn't has mbstring when i searched ...anyone please help me for this issue.

Thanks in advance.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • Does this answer your question? [phpMyAdmin Error: The mbstring extension is missing. Please check your PHP configuration](https://stackoverflow.com/questions/30047169/phpmyadmin-error-the-mbstring-extension-is-missing-please-check-your-php-confi) – Hitesh Tripathi Jul 11 '20 at 04:10

2 Answers2

1

The cli and apache or nginx module have different config paths and, probably, different configs. Your module is enabled on cli but disabled to web.

You need to check your php.ini

If you try to do this (on terminal):

$ php -a
phpinfo();

In a point you can see the php.ini path.

Do the same thing on your www directory creating a phpinfo.php and calling the phpinfo() function and check the php.ini path.

Probably is not the same path and not the same configurations because we have a ini file to cli and to the apache/nginx module. So, you can fix it seeing which file is loading the modules and point to enable the module on web.

If is in different path, probably you'll need to enable or install the mbstring module on web version.

Considering that you're using php-fpm you can install mbstring module with the following command:

php-fpm install mbstring

William Prigol Lopes
  • 1,803
  • 14
  • 31
  • Configuration File (php.ini) Path - /etc/php/7.2/fpm ...this is showing in info.php on browser sir... – syed fazil Jul 10 '20 at 12:07
  • in terminal,below command given php --ini Configuration File (php.ini) Path: /etc/php/7.2/cli Loaded Configuration File: /etc/php/7.2/cli/php.ini Scan for additional .ini files in: /etc/php/7.2/cli/conf.d Additional .ini files parsed: (none) it shows that cli/php.ini file is loading but in browser info.php loaded configuration file is showing /fpm/php.ini file ... – syed fazil Jul 10 '20 at 12:40
  • Yes, different paths, different configurations. You'll need to enable mbstring on your `fpm` installation. Look at the `modules.conf` – William Prigol Lopes Jul 10 '20 at 13:07
0

In case of Windows,

  1. Edit the php.ini file
  2. update extension_dir = "ext" to extension_dir = "C:\php\ext" (may vary based on your system)
  3. Remove semicolon from ;extension=php_mbstring.dll and change it to extension=php_mbstring.dll
  4. You also need to enable mcrypt as well by uncomment/remove semicolon from ;extension=php_mcrypt.dll. (Generally phpmyadmin also gives error for mcrypt)
  5. Save your php.ini file
  6. Restart the apache server

For ubuntu,

  1. Open terminal
  2. Enter command sudo apt-get install php-mbstring php7.0-mbstring php-gettext libapache2-mod-php7.0
  3. Restart apache sudo systemctl restart apache2

If above method doesn't work, explicitly enable mbstring and mcrypt extensions:

sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo systemctl restart apache2

Hope it works for you!!

Ankit Jindal
  • 3,672
  • 3
  • 25
  • 37