6

自从我上周五进行了定期软件包更新以来,我的网络服务器遇到了一个相当棘手的问题。使用 mysql_connect() 时出现错误。

Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50532 Library:100005 in /srv/www/***/wp-includes/wp-db.php on line 1142

当我运行 php -i 我得到:

mysqli

MysqlI Support => enabled
Client API library version => 10.0.5-MariaDB  
Client API header version => 5.5.32

apt-get 安装 mariadb*

导致已安装以下软件包:

libmariadbclient18 is already the newest version.
libmariadbclient18 set to manually installed.
mariadb-client is already the newest version.
mariadb-client-10.0 is already the newest version.
mariadb-client-10.0 set to manually installed.
mariadb-client-core-10.0 is already the newest version.
mariadb-client-core-10.0 set to manually installed.
mariadb-common is already the newest version.
mariadb-common set to manually installed.
mariadb-server is already the newest version.
mariadb-server-10.0 is already the newest version.
mariadb-server-10.0 set to manually installed.
mariadb-server-core-10.0 is already the newest version.
mariadb-server-core-10.0 set to manually installed.

我已经在整个网络上查找了这个问题,但是似乎没有一个类似的问题带有带有库版本的 -MariaDB 标记。

所以我不知道如何解决这个问题。

非常感谢您的帮助!

编辑:

php -i mysql:

MySQL Support => enabled
Client API version => 10.0.5-MariaDB

奇怪的是,本节没有提及客户端 API 库版本或客户端 API 标头版本。

4

2 回答 2

3

为 PHP启用mysqlndnd_mysqlnd_mysqli扩展,如果启用了 mysql 和 mysqli 则禁用它们 (PHP 5.5)。

响应较晚,但这在搜索结果中很高,这是对我有用的解决方案,因为我没有管理员访问服务器的权限。

于 2015-04-05T14:16:38.187 回答
3

安装mysqlndPHP 包,警告应该会消失。

对于基于Debian/Ubuntu的系统,这将是:

sudo apt install php-mysqlnd

或者

sudo apt install php7.0-mysqlnd

安装后重新启动服务器守护进程(apache、nginx 和/或 php-fpm)

于 2014-04-22T17:56:22.403 回答