I've been going round in circles here with PHP7, MariaDB and Wordpress. Hopefully some one here can help me out.
My starting point is the Wordpress error:
"Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
I can't see anything wrong with my php installation. (php7-cli.tcz, php7-ext.tcz, php7-mod.tcz).
The .ini file has
extension_dir=/usr/local/lib/php/extensions/no-debug-zts-20170718
In the files sitting in that directory we have:
bcmath.so mysqli.so shmop.so
bz2.so oci8.so simplexml.so
calendar.so odbc.so snmp.so
..... ........ ......
The command php -m gives me a shorter list which overlaps with some of those above. It doesn't include mysqli.so.
Is this listing just compiled in modules or should I be seeing the complete list from the extension_dir?
I tried a simple php script to check a database and got:
rose@mirror:~$php -f db-connect-test.php
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /home/rose/db-connect-test.php:10
Stack trace:
#0 {main}
thrown in /home/rose/bd-connect-test.php on line 10
Next I set enable_dl in the ini file to On and added the line
dl("mysqli.so");
This gave me the error message:
PHP Warning: dl(): Unable to load dynamic library 'mysqli.so'
(tried: /usr/local/lib/php/extensions/no-debug-zts-20170718/mysqli.so (libmysqlclient.so.18: cannot open shared object file: No such file or directory),
/usr/local/lib/php/extensions/no-debug-zts-20170718/mysqli.so.so (/usr/local/lib/php/extensions/no-debug-zts-20170718/mysqli.so.so: cannot open shared object file: No such file or directory))
in /home/rose/bd-connect-test.php on line 10
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /home/rose/bd-connect-test.php:12
Stack trace:
#0 {main}
thrown in /home/rose/bd-connect-test.php on line 12
What is going on here? It reports [color=#ff0000]tried: /usr/local/lib/php/extensions/no-debug-zts-20170718/mysqli.so[/color] and the file is there....
Finally I tried:
rose@mirror:~$ php --re mysqli.so
Exception: Extension mysqli.so does not exist
rose@mirror:~$ php --ri mysqli.so
Extension 'mysqli.so' not present.
rose@mirror:~$
What is going on? Why is the mysqli.so extension not being found and used?