Closed WenisOK closed 1 week ago
Sorry, I commented in the wrong thread.
Will this test code always result in an error? Also, could you tell me the version of MySQL?
Will this test code always result in an error? Also, could you tell me the version of MySQL?
yeah, my mysql version is 8.4 lts
This extension is compiled using the following commands in the ext/mysqli
folder under the source code
phpize
./configure --with-php-config=/path/to/bin/php-config
make
make install
When executing make test
, it reported any error, even though I enabled the following settings in php. ini
...
extension=mysqlnd
extension=mysqli
...
I have already installed the following packages in advance
libxml2-dev libsqlite3-dev pkg-config build-essential libpcre2-dev zlib1g-dev libmysqlclient-dev
Sorry for the late reply. If the extension is not loaded, you can check that it is not enabled in phpinfo. What state is mysqli in in phpinfo?
Hi, thank you for waiting. Here is the output of the command php -m
:
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /work/php8/lib/php/extensions/no-debug-non-zts-20230831/mysqlnd (/work/php8/lib/php/extensions/no-debug-non-zts-20230831/mysqlnd: cannot open shared object file: No such file or directory), /work/php8/lib/php/extensions/no-debug-non-zts-20230831/mysqlnd.so (/work/php8/lib/php/extensions/no-debug-non-zts-20230831/mysqlnd.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /work/php8/lib/php/extensions/no-debug-non-zts-20230831/mysqli (/work/php8/lib/php/extensions/no-debug-non-zts-20230831/mysqli: cannot open shared object file: No such file or directory), /work/php8/lib/php/extensions/no-debug-non-zts-20230831/mysqli.so (/work/php8/lib/php/extensions/no-debug-non-zts-20230831/mysqli.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[PHP Modules]
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
hash
iconv
imagick
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
random
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
This is how I wrote it in the PHP file 'php info. php'
<?php
phpinfo();
?>
This is the output of 'phpinfo', it doesn't look like there are any errors, just a warning prompt?
Oh, I'm sorry, I forgot to tell you that after being unable to connect to the database, I recompiled PHP using the following compilation parameters./configure --prefix=/path/to/php8 --enable-fpm --with-mysqli=mysqlnd
, After successful compilation, the database can connect normally, but this warning appears.
Thanks, that warning should go away if you remove or comment out the following:
extension=mysqlnd
extension=mysqli
Thanks, that warning should go away if you remove or comment out the following:
extension=mysqlnd extension=mysqli
Yes, it is already enabled in PHP.ini
Description
when I executed
make test
,the console threw a series of the same errors. such asFatal error: Uncaught Error: Class "mysqli_driver" not found in /root/php-8.3.9/ext/mysqli/tests/connect.inc:9
see more please read attached file. php_test_results_20240710_2111.txtThe following code:
Resulted in this output:
PHP Version
PHP 8.3.9
Operating System
Debian 12.5