0
votes

When i run

php -v

Got an error like

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/php_mbstring.dll' - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0

And tried the solution with install mbstring like

sudo apt-get install php-mbstring

after that tried with enable it like:

sudo phpdismod mbstring # disable mbstring extension
sudo phpenmod mbstring # enable mbstring extension again

But enable to find the solution also tried with php.ini.

1
How many installation of php are there on your system check in /etc/M A SIDDIQUI
There is two folder php5 and php. in php there is 3 different folder 5.6,7.0,7.1 @MASIDDIQUIIshan Shah
Thats creating the problem ... In one environment its better to install one php, so you may think of removing 5.6, 7.0M A SIDDIQUI
@MASIDDIQUI but when i run phpnfo() at that time it shows 5.6 and when run php -v then it shows 7.1.xIshan Shah
To install mbstring in php5.6 you need to do is sudo apt-get install php5-mbstring and then tryM A SIDDIQUI

1 Answers

1
votes

It seems as if you have multiple versions of PHP installed. It also is likely that all those versions of PHP refer to the very same configuration file (php.ini). This configuration file then loads extensions which are available just for some of the PHP installations but not for all.

Furthermore, it seems as if you use a different version of PHP from command line than for your web server.

  • If you run php -i from command line, you get information about default PHP CLI (command line interface) installation.
  • If you add a file phpinfo.php with <?php phpinfo(); ?> somewhere in your htdocs (web server) directory, you see the default PHP version for the web.

Even more strange is that you are trying to load a Windows extension php_mbstring.dll even though you seem to be on Linux.

You should check for each installed PHP which configuration file it uses. The information is part of the output of php -i or phpinfo(). Make sure different versions of PHP use different configuration files.

Check where the DLL file is loaded from via grep -iRn 'php_mbstring.dll' /etc. Remove this line or change it to the Linux extension (likely extension=mbstring.so).