Php7-mod-mysqli - help appreciated!

Hey guys!

I have recently been working on a project that requires use of mysqli in order to talk to a remote database

I am using the D-Link DWR-921, it is using the default uhttpd web-server. Within contains a php file which does a simple INSERT INTO a remote DB.

php7 works absolutely fine however, the following modules do not load due to this error

Thu Apr 16 20:11:18 2020 daemon.err uhttpd[4449]: PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib/php/mysqli.so (Error relocating /usr/lib/php/mysqli.so: mysqlnd_reverse_api_register_api: symbol not found), /usr/lib/php/mysqli.so.so (Error loading shared library /usr/lib/php/mysqli.so.so: No such file or directory)) in Unknown on line 0

Within the web page itself it shows this error

Fatal error: Uncaught Error: Class 'mysqli' not found

It shows this even though that mysqli has been "installed" via

opkg install php7 php7-cgi php7-mod-mysqli

I have added the following both lines into php.ini and back out which has not made a difference

extension=mysqlnd.so
extension=mysqli.so

I have now re-flashed my device and re-configured it with no difference at all

I have completely run out of ideas, any help is greatly appreciated!

I would look and see if you have the following files:
/usr/lib/php/mysqli.so.so
/usr/lib/php/mysqli.so

I really don't know the relationship of these files or what it's trying to do but it does seem obvious that it is looking for one or both of these files. I would look to see if they're there.

Some info missing here. Don't know what you're running.

mysqlnd_reverse_api_register_api() is provided by mysqlnd.so. So this module needs to get loaded before mysqli.so.

Normally the files in /etc/php take care of the loading order:

root@hank2:/etc/php7# ls
15_openssl.ini  20_hash.ini     20_mysqlnd.ini  30_mysqli.ini
root@hank2:/etc/php7#

Works for me. Not sure what setup you have.

Thanks for the suggestions, I had tried them but it still would not work. Anyway, I had given up and just simply moved the web server elsewhere and it's working fine now!

Thanks again <3

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.