简体   繁体   中英

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/msqli.so'

Looked at all the articles on search for this and no answers that work -- on Ubuntu 16.04 I'm getting:

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

msqli.so is definitely there in the folder cited above and is owned by root and is excutable. Folder and parent folders are owned by root. Hell of it is, phpmyadmin is running fine and can see and operate on the mySQL databases just fine. Do I need to chown folders/files to mysql or php entities? Just reinstalled Apache/php/mysql today and that did not fix it - all latest versions. Trying to use Eclipse IDE but this code fails on web server, too. Also tried in php.ini extensions pdo_ msql.so and msqlnd.so and related coding techniques, but they all resulted in messages like the above (but with appropriate.so filename) so I suspect its 'environmental' something wrong in setup. phpinfo() ; suggests the drivers are all there and working.

It seems that uninstalling all versions of php with

sudo apt-get purge `dpkg -l | grep php | awk '{print $2}' | tr "\n" " "`

and only installing the latest version with

apt install php libapache2-mod-php php-mysql php-xml php-soap php-gd php-mbstring

solved the problem for me.

Solved it with help from this post .

Changed php.ini:

extension=/usr/lib/php/20151012/mysqli.so
extension=/usr/lib/php/20151012/mysqlnd.so

to

extension=/usr/lib/php/20151012/mysqlnd.so
extension=/usr/lib/php/20151012/mysqli.so

ie: reversed the order of the 2 entries to put mysqlnd.so first.

Now I am all happy and telecomputing with alacrity and enthusiasm.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM