1

I am using Debian Jessie here, and I have got a couple of PHP pages showing the error:

A PHP Error was encountered
Severity: Warning

Message: mysqli::real_connect(): Headers and client library minor version mismatch. Headers:50553 Library:50630

Filename: mysqli/mysqli_driver.php

The php5 package is 5.6.30+dfsg-0+deb8u1.
The php5-mysql package is 5.6.30+dfsg-0+deb8u1.

Both are standard Debian packages, and I have not compiled by hand any part of the components.

I tried apt update and upgrade, reinstalling php5-mysql, and restarting Apache, but it did not solve the problem.

phpinfo() also complains about mismatched versions in php5-mysql.

What to do?

1

This seems a bug packaging php5-mysql; I found a related question in this post Headers and client library minor version mismatch.

While not the accepted answer, the most pertinent answer in that link is:

For new MySQL 5.6 family you need to install php5-mysqlnd, not php5-mysql.

Remove this version of the mysql driver

sudo apt-get remove php5-mysql And install this instead

sudo apt-get install php5-mysqlnd

However, for maintaining the consistency of dependencies, uninstalling php5-mysql is not the best of the ideas; it is much better doing:

sudo apt-get install php5-mysqlnd

And letting the dependencies uninstall php5-mysql while installing php5-mysqlnd.

From packages.debian.org: Package: php5-mysqlnd

MySQL module for php5 (Native Driver)

This package provides modules for MySQL database connections directly from PHP scripts. It includes the generic "mysql" module which can be used to connect to all versions of MySQL, an improved "mysqli" module for MySQL version 4.1 or later, and the pdo_mysql module for use with the PHP Data Object extension.

After doing sudo apt-get install php5-mysqlnd, the pages in question started working normally, without giving that warning.

However, other legacy pages in another of the pages still using latin1 / iso-8859-1 started displayed funny letters e.g. being forced to UTF-8, so we had to rollback on that server to php5-mysql.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.