问题原文
原帖链接 · fgblomqvist · CC BY-SA 3.0
I have been trying to get PHP CLI (7.0.7 on Ubuntu) working together with mysqli, but without success. I keep getting the same error message when starting it:
mysqli.so: undefined symbol: mysqlnd_connect in Unknown on line 0
This is some of the output from php -i (clearly showing both were loaded):
mysqli
MysqlI Support => enabled
Client API library version => mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0
Directive => Local Value => Master Value
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
mysqlnd
mysqlnd => enabled
Version => mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $
Compression => supported
core SSL => supported
extended SSL => supported
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 31536000
Collecting statistics => Yes
Collecting memory statistics => No
Tracing => n/a
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password
API Extensions => mysqli,pdo_mysql
PHP was installed using sudo apt install php7.0-cli.
What is wrong?
社区高分解答
原帖链接 · Jonathan King · CC BY-SA 3.0
When you load mysqli after mysqlnd, this solves the issue. BUT
if you use phpenmod to enable the modules they enable in alphabetical order. mysqli is before mysqlnd in the order.
I got around this by renaming the symlinks to mysqli to zmysqli - crude, but it worked.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
