Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to load dynamic php_mbstring.dll library

I am checking for my php version using

php -v

command in console and I am getting a WARNING below

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0 PHP 7.0.4-7ubuntu2 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

I have uncommented this line extension=php_mbstring.dll in my /etc/php/7.0/fpm/php.ini file and this doesn't seem to solve my problem. How would i get rid of this warning?

like image 671
jaahvicky Avatar asked Apr 30 '16 10:04

jaahvicky


2 Answers

I was running into the same PHP warnings when trying to run it from the command line. This was on a Homestead Vagrant Ubuntu box, where i was getting:

 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

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

What I didn't realize is that it uses a php.ini in a separate /cli/ directory (E.g. /etc/php/7.X/cli/php.ini) when you're running php on the command line or using a CLI that uses PHP

Based on the paths in your question, look for /etc/php/7.0/cli/php.ini and you should comment out the mbstring module (assuming Linux):

extension=php_mbstring.dll
;extension=php_mbstring.dll ; commented out

If this doesn't solve the issue for you, try running:

php -i | grep -i "Loaded Configuration File"

This pointed me at the correct php.ini file:

Loaded Configuration File => /etc/php/7.1/cli/php.ini
like image 165
JDev518 Avatar answered Nov 16 '22 03:11

JDev518


In php.ini search "extension_dir" : uncomment for the platform (in my case it is on Windows:)

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "ext"
like image 39
Bretzelus Avatar answered Nov 16 '22 03:11

Bretzelus