On 20.11.2022 17:13, Boyd Lynn Gerber wrote:
Hello,
Thanks, Admin Beckspaced <admin@beckspaced.com> It is True it doesn't why adding the below is required.
In /etc/php7/apache2/php.ini the below 2 lines are required for PHP 7 and above.
extension=mysqli extension=pdo_mysql
Now with the updated PHP
$ php -version PHP 8.0.10 (cli) (built: Feb 22 2022 12:00:00) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.10, Copyright (c) Zend Technologies with Zend OPcache v8.0.10, Copyright (c), by Zend Technologies
So I just tried adding them to /etc/php8/cli/php.ini
$ php -version PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib64/php8/extensions/mysqli (/usr/lib64/php8/extensions/mysqli: cannot open shared object file: No such file or directory), /usr/lib64/php8/extensions/mysqli.so (/usr/lib64/php8/extensions/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
It rather clearly says that it cannot load extension because some other required library is missing. You may want to google for "undefined symbol: mysqlnd_global_stats".
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib64/php8/extensions/pdo_mysql (/usr/lib64/php8/extensions/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib64/php8/extensions/pdo_mysql.so (/usr/lib64/php8/extensions/pdo_mysql.so: undefined symbol: mysqlnd_allocator)) in Unknown on line 0
$ l /usr/lib64/php8/extensions/mysqli.so -rwxr-xr-x 1 root root 138352 May 7 2022 /usr/lib64/php8/extensions/mysqli.so
PHP 8 updated and now shared libraries are not being loaded.
All wordpress sites worked and phpinfo displayed mysqli Sadly after upgrading to PHP 8 php.ini. It fails.
On Sunday 2022-11-20 10:54, Admin Beckspaced wrote:
PHP 8 doesn't have function mysql_connect() you need to convert your code to mysqli_connect()
Google is your friend
Thanks, I wish google assisted but, Sadly it doesn't. I opened a case with wordpress community when things failed with PHP 7. Updateing PHP 7 removed the line.
the /etc/php7/apache2/php.ini file was deleted and the file used on the update was missing the line
extension=mysqli
https://wordpress.org/support/topic/linux-leap-15-4uncaught-error-call-to-un...
Sadly the same solution doesn't work. mysqli isn't found.
Wordpress tries to use mysqli_connect() and falls back to the old funstion. And prints it as the message in the error log.
I am using mysqli_connect() It is the mysqli extenstion above in the PHP 8 /etc/php8/apache2/php.ini It has to be there for both PHP 7 and PHP 8.
What I just learned when adding the variable to the CLI php.ini file the dynamic libraries are not being loaded. I'm not sure if the same applies to the apache2/php.ini failing. I now have to investigate this
Regards,