Problem with php7-mod-mysqli package

Hi, community!

My OpenWRT device is:

Model: TP-Link Archer C20 v1
Architecture: MediaTek MT7620A ver:2 eco:6
Firmware Version: OpenWrt 18.06.0 r7188-b0b5c64c22 / LuCI openwrt-18.06 branch (git-18.210.69179-6df9a57)
Kernel Version 4.14.54

I have installed next packages:

php7 php7-cli php7-mod-msyqli php7-mod-mysqlnd php7-mod-hash

When I run a test script, it show me next:

root@LEDE:~# php-cli 1.php
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqlnd.so' (tried: /usr/lib/php/mysqlnd.so (Error relocating /usr/lib/php/mysqlnd.so: RSA_size: symbol not found), /usr/lib/php/mysqlnd.so.so (Error loading shared library /usr/lib/php/mysqlnd.so.so: No such file or directory)) in Unknown on line 0
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

Fatal error: Uncaught Error: Class 'mysqli' not found in /root/1.php:2
Stack trace:
#0 {main}
  thrown in /root/1.php on line 2

Any ideas?:slight_smile:

Try this. Check /etc/php7/

Rename 20_mysqli.ini to 30_mysqli.ini, or delete 20_mysqli.ini if both exist. If you also have 20_openssl.ini there, rename that to 10_openssl.ini.
Above change is needed to load the modules in the correct order.
This should now be fixed in the latest builds, but you could be running older code, or suffering from the bug that was there earlier.

1 Like

Thank you, it works now.

My current order in /etc/php7 is:

root@LEDE:/etc/php7# ls -la
drwxr-xr-x    2 root     root          4096 Aug 28 02:49 .
drwxr-xr-x    1 root     root          4096 Aug 24 01:15 ..
-rw-r--r--    1 root     root            21 Aug 24 01:15 10_openssl.ini
-rw-r--r--    1 root     root            18 Aug 24 01:15 20_hash.ini
-rw-r--r--    1 root     root            22 Aug 24 01:15 20_mbstring.ini
-rw-r--r--    1 root     root            21 Aug 24 01:15 20_mysqlnd.ini
-rw-r--r--    1 root     root            17 Aug 24 01:15 20_pdo.ini
-rw-r--r--    1 root     root            23 Aug 24 01:15 20_pdo_mysql.ini
-rw-r--r--    1 root     root            17 Aug 24 01:15 20_xml.ini
-rw-r--r--    1 root     root            20 Aug 24 01:15 30_mysqli.ini

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