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?
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
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With