3

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.

3
  • Did you check if the mysqli.so file is in /usr/lib/php/20151012/?
    – itsols
    Commented Mar 15, 2018 at 5:27
  • 1
    Yes, that's what I meant when I said "msqli.so is definitely there in the folder cited above" Commented Mar 15, 2018 at 8:01
  • not answering the question in any way, but I spotted the apparent datestamp in the folder path and I just had to come and ask, are you actually using a 2015 version of PHP (eeek!!!) or do you just have a weird folder name there?
    – Spudley
    Commented Sep 25, 2018 at 21:52

2 Answers 2

11

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.

0
9

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.

1
  • 2
    That solved my problem too!! I had only 'extension=mysqli', so I added 'extension=mysqlnd' before 'extension=mysqli' and that worked! Commented Aug 24, 2019 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.