Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL => MariaDB = PHP Errors Header/Library versions

Tags:

php

mysql

mariadb

I managing a little vps of my own and I've recently moved from mysql to mariadb (5.3).

On some php test projects that usually worked under php5/mysql5, I get some header errors about MySQL versions.

  Headers and client library minor version mismatch. Headers:50158 Library:50303 

My guess here is : MariaDB 5.3 is the Library, and the Headers is the libmysqlclient.

I don't know where I've failed when updating/installing (even tried remove mysql and only install mariadb) but it seems that it happens with the php-mysql package.

I've tried to use the -o from apt-get to configure --with-mysql=mariadb-devel as I've seen on a topic, but in fact, it seems I don't know how to configure php5-mysql package (I don't even know what does it do : configurations files or libraries ?)

Well to sum up, why is my PHP5 MySQL header still in 5.1 where the library is 5.3 ?

Thank you in advance for any help, Lucas.

[ Plus ] How can I recover the configure parameters from an apt-get install ? I've got no results when i use :

php5 -i | grep configure
like image 781
lovethebomb Avatar asked Sep 24 '26 04:09

lovethebomb


1 Answers

Your PHP5 MySQL header still in 5.1 where the library is 5.3 is because PHP was not recompiled with the new headers (nor it should be because 5.3 remains binary backward compatible).

The check in the driver in itself is wrong, or better say too overcautious. PHP (mysqli) is unique among MySQL drivers in that it would barf when minor version is higher than the one that was compiled in.

Here is bug report for PHP MySQL driver

like image 190
Vladislav Vaintroub Avatar answered Sep 26 '26 17:09

Vladislav Vaintroub



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!